Don't use an alias variable, TTT must be the name or id of the concerned
table...
Verify with XXX, not TTT in the IF statement
try this

Dim TTT, XXX as String
TTT = "CRAZY TABLE"
XXX = "COLUMN TO FIND"
Nbcoclumn = TableInfo(TTT,TAB_INFO_NCOLS)
For i=1 to Nbcolumn
    testname=ColumnInfo(TTT,"COL"+i,COL_INFO_NAME)
    If testname=XXX then
        print "OK"
    end if
next

___________________________________

||    //            Antoine Gilbert
||   //              [EMAIL PROTECTED]
||  //                #ICQ 9737371
||  \\
||   \\        Le Groupe KOREM Inc.
||    \\      http://www.korem.com

Push'n'See : www.pushnsee.com
MIG        : www.mig.ca
___________________________________

----- Original Message -----
From: Fran�ois Molle <[EMAIL PROTECTED]>
To: MAPINFO-L <[EMAIL PROTECTED]>
Sent: Thursday, July 06, 2000 8:20 AM
Subject: MI MB: how to check if column XXX exists in table TTT


>Dear All
>
>Apparently, there are no function to know if column XXX exists in table
>TTT (is there ?)
>So I built a loop on all columns name to check whether one is equal to
>XXX.
>
>TTT as Alias, tesname as string
>
>For i=1 to Nbcolumn
>testname=ColumnInfo(TTT,"col"+str$(i),COL_INFO_NAME)
>If testname=TTT then print "OK" end if
>next
>
>For some reason, it does not accept this and gives the error:
>"Variable or Field TTT not defined"
>Is it because of the mismatch of variables, String and Alias ?
>If I use testname=str$(TTT) is does not work either.
>
>Thanks for any help to draw me out of this deadlock...
>Francois
>
>----------------------------------------------------------------------
>To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
>"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
>

----------------------------------------------------------------------
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