Sounds like you are destroying a MapInfo generated temporary table and it's
complaining when it's trying to access it. Why don't you keep track of the
temporary tables you create and then destroy them (rather than going through
everything that is open.) Programming wise, the experts would probably say
to keep track of things explicitly, rather than looping through
possibilities where you might get into trouble.
Alex Machinis
EMPOWER GEOGRAPHICS, INC.
1000 Executive Way
Des Plaines, Illinois 60018-1502
847/299-6952 x212 Fax: 847/299-6990
http://www.empowergeo.com
mailto:[EMAIL PROTECTED]
Note: this message and any attachments have been scanned and checked for
viruses. You may want to perform checks with your own anti-viral
software.
-----Original Message-----
From: Majors, Randy [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 11, 1999 03:00 PM
To: [EMAIL PROTECTED]
Subject: MI EndHandler problems
I have some MapBasic code which contains an EndHandler routine which
performs some scrap-file cleanup. It works fine with any number of
tables/configurations open, EXCEPT when I have a table open that is the
results of a SQL grouped-by function (eg Query1 is a grouped-by table
based on a SQL query of a base table). In that scenario, when the program
is ended or I exit MapInfo, the end handler produces an error of:
File #0 not registered for access.
Here's the code: (I'm thinking the line containing TAB_TYPE_BASE should keep
it from trying to evaluate the SQL grouped-by tables, but maybe not...)
'
Sub EndHandler
DIM i as Integer '...the current table in the
loop of NumTables()
For i = NumTables() to 1 Step -1
If TableInfo(i, TAB_INFO_TYPE) = TAB_TYPE_BASE then
If
((Left$(PathToFileName$(TableInfo(i,TAB_INFO_TABFILE)),1) = "_" or
Left$(PathToFileName$(TableInfo(i,TAB_INFO_TABFILE)),1) = "~" ))
and
PathToDirectory$(TableInfo(i,TAB_INFO_TABFILE)) =
PathToDirectory$(TempFileName$("")) then
Drop Table TableInfo(i,TAB_INFO_NAME)
End If
End If
Next
End Sub
'
Any help much appreciated.
Randy Majors - Manager, GIS & Mapping
Resource Data International 303-444-7788
<http://www.resdata.com> http://www.resdata.com -
<mailto:[EMAIL PROTECTED]> [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]
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]