Thanks to everyone who replied to my query.

There were two lines of thinking for this one - use the error trap, or loop
through the open tables to see if any match the one you're after.

The one I think I will end up using is the error trap. Below is an example
code I was sent.

*******************************************************************
Declare Function IsTableOpen(ByVal sTabName as String) as Logical

' usage = IsTableOpen("States")
' returns true or false

Function IsTableOpen(ByVal sTabName as String) as Logical
        Dim n As Integer

        IsTableOpen = True
        OnError Goto ERROR_SPOT
        n = TableInfo(sTabName, TAB_INFO_NROWS)

        Exit Function

        ERROR_SPOT:
                  IsTableOpen = False
                  Exit Function
End Function
*******************************************************************

Again, thanks for all the replies. It's wonderful to see so many people
eager to help.


Cheers,

Simon
-----------------------------------
Simon O'Keefe
GIS & Mapping Consultant
Groundtruth GIS
PO Box 162
Daylesford VIC 3460
Australia



-----Original Message-----
From: Simon O'Keefe
Sent: Friday, September 07, 2001 9:33 AM
To: [EMAIL PROTECTED]
Subject: MI-L how to tell if a table is already open?


Hi all,

>From a MapBasic program I am writing, I would like to be able to tell
whether a certain table (eg sample.TAB) is already open or not. Any
suggestions?

Thanks,

Simon



_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to