The simplest solution is to start a counter, append it to your
base table name and simply use OnError to trap the error
generated when you try to open a table that doesn't exist.
A much more elegant (and general purpose) solution is to use the
GetFilenames() function in the "File, Director, Drive, Path"
section of the MapBasic Resources Center at
http://www.paris-pc-gis.com/mb_r/mbr_start.htm. This retrieves a
list of file names based on a standard DOS/Windows filespec
pattern. Source code is included as well.
"Snashall, Scott" wrote:
> I have a mapbasic script that creates multiple tables that get
> placed within a directory. Each table has the exact same name accept for a
> counter ie (table1.tab,table2.tab) All the fields wihtin the table are
> exactly the same.
>
> I woud like to append these tables into one master table(mastertable.tab).
> As well the number of tables that gets placed within this directory will
> very.
>
> ie
>
> C:\temp contains
>
> table1.tab
> table2.tab
> table3.tab
>
> would like to append and create
>
> mastertable.tab
>
> the next day
>
> C:\temp could contain
>
> table1.tab
> table2.tab
> table3.tab
> table4.tab
> table5.tab
>
> How can I have mapbasic loop through this directory determine the
> number of tables within that directory and then append all of these tables
> into on master file.
--
- Bill Thoen
------------------------------------------------------------
GISnet, 1401 Walnut St., Suite C, Boulder, CO 80302
tel: 303-786-9961, fax: 303-443-4856
mailto:[EMAIL PROTECTED], http://www.gisnet.com/
------------------------------------------------------------
~~~~~~~~~~ Advertisement ~~~~~~~~~~~
Middle East Datasets from LAND INFO
Imagery, digital elevation models (DEM), topographic maps, and vector layers
are now available for Saudi Arabia, United Arab Emirates, Kuwait, and other
regions. Visit http://www.LANDINFO.com/directions.htm for imagery and map
datasets covering over 125 countries.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________________________________
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.