Hi again,
Many thanks to those who responded to my query, and especially thanks to Dmitry Bogdanov and Brian from New Zealand, who between them provided me with the clues I needed to achieve what I wanted.

I thought it worthwhile posting a summary as a few of those that responded expressed similar frustrations to my own.

My original query concerned how I could go about referencing a column number with a smallint variable when using the Update statement.

It seems that it can be done, but there are a few tricks;

Firstly, when you wish to use variables in the Update Statement, you need to construct (concatenate) everything into a Run Command statement.

And secondly, when concatenating, any string variables must be enclosed in double quotes.

So.....the line of code that I finished up with (that works) is as follows:

Run Command "Update f68 Set Col" & str$(endcol-yearno+1) & " = "" & newrecord & "" where rowid = " & selected

Note the double quotes enclosing newrecord....it is a string variable whereas the others (endcol,yearno and selected) are all smallint.

I'm not sure if there are any other ways to do this, but this is the only way I have found so far that works. Again, many thanks for the responses.

regards,

Darren :)






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Darren Murphy Technical Officer
Bureau of Meteorology Darwin NT (Australia)
Phone +61 8 89203818 Fax +61 8 89203842
http://www.nt.bom.gov.au/ntregion/obs/obs.html (work)
http://www.darwin8ball.org (play)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---------------------------------------------------------------------- To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to