I don't know if this will help you but I was getting the same error message when I had a variable defined with the same name as the column name in the code. It just about drove me nuts (I kept looking for a typing error that wasn't there). Just guessing that the "9" is "being seen" as a number instead of a string?
-----Original Message----- From: Benjamin Scott [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 12, 2004 12:43 AM To: [EMAIL PROTECTED] Subject: MI-L Update command and alias variables in mapbasic Hi all, I am having problems with the use of variables to store column numbers when using the "update" command in a mapbasic script. I want to use a variable to provide the column number (so I can use a for loop to loop through columns). The code (as shown below in a very simplified format) yields the error message "expression does not evaluate to a column or table name" j = 6 Temp1column = "COL(j)" Update temp1 Set Temp1column = 9 Obviously I am not handling the COL(j) string correctly but I can't seem to find how to do it - have tried j = 6 Temp1column = "COL(" + j + ")" Update temp1 Set Temp1column = 9 as well with the same result. Even getting rid of the alias variable, the problem seems to be that the update function can't handle a variable determining the column number - ie j = 6 Update temp1 Set COL(j) = 9 and j = 6 Update temp1 Set temp1.COL(j) = 9 Dont work either BUT Temp1column = "COL6" Update temp1 Set Temp1column = 9 DOES work It seems that it simply doesn't allow me to substitute the variable j for the column number. Is this just a limitation of MapBasic that it only deals with real numbers in column names stored in alias variables and in the update command?? It seems strange because any column name, whether in the format of COL6, COL(j), the actual column name, or an alias variable containing the name, seems to be written up in the manual as though it is seen by mapbasic functions as the same thing. Any suggestions? Regards, Ben Scott Environmental GIS Analyst City Solutions Blue Mountains City Council (02) 4780 5433 --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 11709 --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 11721
