Scott,
It sounds like you want to construct strings that can be executed as
MapBasic commands. The spirit of this idea is to do something like the
following:
Dim Cmd as string
Dim Path as string
Dim City as string
'-- to create a new table named after the value of City
Cmd = "Create Table " + City + " (ID Char(32)) File "
Cmd = Cmd + chr$(34) + Path + Chr$(34) + " Type Native"
Run Command Cmd
Note: you may want to do the following:
1) Keep your mapbasic window open in MI Pro as you work so you can
become more familiar with MapBasic syntax (many menu choices result in
the commands being printed to the window).
2) read up on MapBasic functions such as CommandInfo, FileSaveAsDlg, etc
that can help you gain info on choices the user makes ( or should make).
For example, CommandInfo(CMD_INFO_MENUITEM) returns an integer telling
you the ID of the menu item the user selected; this should help you give
the variable 'city' a meaningful value.
3) Become familiar with the 'Dialog' keyword if you're planning to build
dialogs using MapBasic.
- Tom
**********************************
Tom A. White, GIS Programmer / Analyst
Schlosser Geographic Systems, Inc.
http://www.sgsi.com [EMAIL PROTECTED]
Two Union Sq. 601 Union St. Seattle, WA 98101 USA
(206) 224 - 0800 fax: (206) 467 - 0458
-----Original Message-----
From: Snashall, Scott [SMTP:[EMAIL PROTECTED]]
Sent: Monday, October 18, 1999 4:36 PM
To: '[EMAIL PROTECTED]'
Subject: MI mapbasic input variables
Hello all,
I am relatively new to mapbasic and programming in general.
In the program I am working on
I have created a pulldown menu which list various cities
ie
Toronto
Chicago
Vancouver
Los Angeles etc
once the user has selected the city he wants and clicked the okay button
the city would be placed into a input variable ie
CITY
I would like to
have one sub routine such as
save copy C:\city.tab as E:\temp\city.tab
in which the input variable city would represent the variable that the
user
has selected
rather than doing
this
IF CITY = toronto then
save copy C:\Toronto.tab as E:temp\toronto.tab
else if city = Chicago then
save copy C:\Toronto.tab as E:temp\Chicago.tab
I am not to sure if this can be done in Mapinfo or if there is a
better way of doing this. If there is any short step solutions,
HELP would be much appreciated
thanks
----------------------------------------------------------------------
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]