Give this a try...


Dim i, j, ColNo As SmallInt

For i = 1 to NumTables()

If TableInfo(i, TAB_INFO_NAME) = "YourTableName" Then

For j = 1 to TableInfo(i, TAB_INFO_NCOLS)
ColNo = "COL" + j
If ColumnInfo(I, ColNo, COL_INFO_NAME) = "YourColumnName" Then Goto
ColumnFound
End if
Next
End if
Next

ColumnFound:
Print "OK"


Scott Barling
GIS/Assets Technical Assistant

Eurobodalla Shire Council
Tel:    +61 (02) 4474 1251
Fax:    +61 (02) 4474 1234
e-mail: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 


        -----Original Message-----
        From:   Fran�ois Molle [SMTP:[EMAIL PROTECTED]]
        Sent:   Thursday, July 06, 2000 10:21 PM
        To:     MAPINFO-L
        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