Hi Arindam,

MapBasic uses a variable type called "alias" for this kind of indirect 
reference operation.

    Dim a as alias
    Dim tablename, columnname, result as string
    a = tablename + "." + columnname
    result = a

Alias variables work with all column types including the feature column OBJ / 
OBJECT.

Furthermore all columns in a table have a secondary "numbered" name in addition 
to their given name. These are as follows: "COL1",
"COL2", "COL3" etc.

I.e., if the 3rd column in table MyTable is named STREET_NAME the two 
statements below are identical:

    name = myTable.STREET_NAME

    name = myTable.COL3

This can be utilized when looping thorugh a column list with ColumnInfo, e.g. 
ColumnInfo("myTable", "COL" + i, COLUMN_INFO_NAME)

HTH

Best regards/Med venlig hilsen
Lars V. Nielsen
GisPro, Denmark
http://www.gispro.dk/
----- Original Message ----- 
From: "Arindam" <[EMAIL PROTECTED]>
To: "Mapinfo" <[EMAIL PROTECTED]>
Sent: Sunday, December 12, 2004 9:06 AM
Subject: MI-L Accessing columns in an open table


Hi ,

Can anybody help me with a technique to access a cell in an open table, whose 
name is not known initially. The trouble is , the
tablename can be identified using the keyword "tableinfo". However once this is 
is assigned to a string variable say "name", I
cannot use "name.columnname" to access a cell, because the variable "name" is a 
string.

Anyone has a solution ?

Arindam


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 14509

Reply via email to