There are more elegant ways to do this but here is one way to do it: '******Copy from here***************************** 'This mb shells out , dirs all table files below a directory(tabledirectorytext), ' pipes to a text file(thetabtext) ' then you loop through the text file opening the tables ' 1) and processing them as you go(individual processing) ' 2) or simply open them all and then process them(batch processing) ' ........ your choice
' All include files Include "Mapbasic.def" 'Called mbx subs Declare Sub Main Declare Sub Timeout Declare Sub OpenTables Declare Sub individualprocess Declare Sub batchprocess Dim thetabtext, cmdstr, tableline, tabledirectorytext as string Sub Main 'This is your text file your piping your dir command to thetabtext = "c:\tab_open.txt" 'This is your desired table directory. This will also get all tables in subdirectories as well. tabledirectorytext = "c:\temp\*.tab" cmdstr = "cmd /c dir " + tabledirectorytext + " /b /s > " + thetabtext Run Program cmdstr Call timeout 'for delay while the command line runs Call OpenTables End Sub Sub Timeout 'Note: depending on the depth of your directory structure and the speed of your processor, you may want to ' increase the hangon variable dim hangon, o, j as integer hangon = 100000 For j = 1 to hangon if j > 1 then o = j end if Next End Sub Sub OpenTables Open File thetabtext For Input as #1 Do Line Input #1, tableline If EOF(1) then Exit Do End If Open Table tableline Call individualprocess Loop Close File #1 Call batchprocess 'Close all End Sub Sub individualprocess 'put your individual table processing here and commit as you go End Sub Sub batchprocess 'put your batch processing,after all tables are open, here 'don't forget to commit changes End Sub '******** to here ************************************ Hope this helps Jon Steve -----Original Message----- From: Jon Petter Nielsen [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 07, 2005 4:52 AM To: Mapinfo-L@lists.directionsmag.com Subject: MI-L (Table) File Open : "OpenAll" Hi listers, We are working on a project where we shall process av lot of tab files (thousands ?), organized on disk under a catalog with several sub-catalogs. MiPro 8 : - File Open : A Maximum of xxx tab files at a time in FileOpen Dialog (bug?) - No " *.* and Search sub-catalogs" flag / option ( we want : "All tab files, include all sub-catalogs") Is there a general max of tab file opened at the same time ?( File Open in a WOR or MB window-commands) Has anyone a hint (or an app ! ) for rapid opening of all tabs under a catalog tree? Rdgs Jon Petter Nielsen Ugland IT Group AS +47 6759 2818 --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 17773 ______________________________________________________________________ This e-mail has been scanned by MCI/MessageLabs Managed Email Service. --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 17777