Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a lot of maps (over 600) to create. They all contain the same column titles and the layouts will be the same. I don't want to have to go through and repeat the same process everytime, I would like to just have to open the file and have it map on its own. I have created a workspace to open the other tables I need for every map, but I need to know if it is possible to write a program or code with mapbasic to ask the user to specify what table to open, then using that finish the program by joining the tables and mapping. The first and last parts I can do. I just need to know how to create a dialog box to have the user select the table, or if it is even possible.

share|improve this question
4  
What GIS software are you utilizing? How's your programming knowledge? –  MLowry Jun 13 '12 at 13:54
    
mapbasic assumes it is for MapInfo - it is possible to automate if you can code. –  Mapperz Jun 13 '12 at 14:01
    
Yes I am using MapInfo. I've got a solid programming base. –  Shelby Bruns Jun 13 '12 at 14:37

3 Answers 3

Yes it is indeed possible to create a dialog box to have the user select a table. Here's a link to the mapbasic 11 reference manual. Page 93 contains the information you require.

share|improve this answer

There are two solutions in MapBasic to let the user select the table. I wrote down the related code samples. In the first way, the user can cancel the operation. In that case mypath will be an empty string. However, in the second way, MapInfo gives you an error when the user cancel the operation.

First way:

dim mypath as string
mypath = fileopendlg("C:\", "hello", "TAB", "hello")

Second way:

open table "C:\foo.tab" interactive
share|improve this answer

If you want to customize your dialog box you can use the .NET-platform, there is a good sample of how to make the connection at {yourMapInfoInstallationFolder}\MapInfo\MapBasic\Samples\DOTNET\HelloWorld.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.