You should use the Alias variable to hold the table and column name.
And you should also use the below mentioned syntax when looping. In this way you won't
get into trouble if you have deleted records in the table.
************************
Dim tab_name, col_Name, col_val As String,
aTabCol As Alias
tab_name = whatever
col_name = whichever
aTabCol = tab_name & "." & col_name
Fetch First From tab_name
Do Until EOT(tab_name)
col_val = aTabCol
Fetch Next From tab_name
Loop
************************
Peter Horsb�ll M�ller
GIS Developer
Geographical Information & IT
COWI A/S
Odensevej 95
DK-5260 Odense S
Denmark
Tel +45 6311 4900
Direct +45 6311 4908
Mob +45 5156 1045
Fax +45 6311 4949
E-mail [EMAIL PROTECTED]
http://www.cowi.dk
> -----Original Message-----
> From: Ron Halliday (Portolan Geomatics) [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 01, 2004 7:16 PM
> To: MapInfo-L
> Subject: MI-L Fetch and Run Command
>
>
>
> Hello listers, I've had this problem before, solved it, and
> now I can't find any code to cut and paste into my new app so
> I have to ask the question again. How do you use the Run
> Command command to use the Fetch command properly when you
> have your table and column names in variables? My code now is:
>
> tab_name = whatever
> col_name = whichever
> For x = 1 to TableInfo(tab_name, TAB_INFO_NROWS)
> Fetch Rec x from tab_name
> col_val = tab_name.col_name
> Next
>
> Thanks in advance!
> Ron
>
>
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine |
> www.directionsmag.com | To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> Message number: 10656
>
>
>
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 10657