| Purpose |
|
Detects if a table is open
|
| Author | Date of code (original) | Updated on | Date of page (original) | Updated on |
|
Jacques Paris jacques@paris-pc-gis.com |
27Apr2001
|
|
27Apr2001
|
|
| Restrictions on use |
|
This module is distributed under the terms of the Lesser GNU General Public License. Restrictions on the use of this work in a commercial application or derivative work is described in the Lesser GNU General Public License page at: http://www.fsf.org/copyleft/lesser.html
|
| Description |
|
Checks the list of open tables to find if there is one with the given name
|
| External resources |
|
none
|
| Declare statement of sub_function. Include in your program. Copy/Paste if needed. |
|
declare function istableopen(byval name as string) as logical
|
| Returned value(s) (function only) |
|
TRUE if table is open FALSE otherwise |
| Other required declare statement(s). Include in your program. Copy/Paste if needed. |
| If not already required by program: include "mapbasic.def" none |
| MapBasic Code. Copy/Paste if needed.
|
|
function istableopen(byval name as string) as logical dim i,ntab as smallint ntab=numtables() if ntab=0 then goto notop end if for i=1 to ntab if tableinfo(i,1)=name then istableopen=1 exit function end if next notop: istableopen=0 end function |
| Availability for download |
| Tables.zip |
| Example |
|
include "mapbasic.def" declare function istableopen(byval name as string) as logical dim a as string dialog title "Testing IsTableOpen()" control statictext title "Enter the name of a table:" control edittext width 150 value "" into a control okbutton if not commandinfo(cmd_info_dlg_ok) then exit sub end if if istableopen(a) then note "Table "+a+" is open" else note "table "+a+" is not open" end if |
| Comments |
|
|
| See also |