Hmmmmmm,

It sure would have been easier and a lot prettier if you had left out the
"without using MapBasic", but anyway I'll give it a shot, eventhough I'm am
using MapBasic just not the compiler, just the MapBasic window and a
workspace.

The only way I can see you can get the user to enter some sort of
information is thru one of the in MapBasic/MapInfo built in dialogs. One of
these is the FileSaveAsDlg() that actually is ment for entering the name and
path of a file to be saved. The dialog itself does only return whatever
value the user entered as a filename.

In the workspace below I have set up some functionality that can extract the
value entered by the user from the filename that the dialog returns after
this a messagebox shown this value and I have then inserted a SQL query that
will select all records where the text column MYCOLUMN in table MYTABLE has
this value.

The line with the Note "..." can of course be removed if you find it
annoying.

You could of have setup the code for creating a DBMS table instead of the
simple query.

**************************************************
!Workspace
!Version 600
!Charset WindowsLatin1
Dim szValue As String
szValue = FileSaveAsDlg("", "Please enter value", "VAL", "Please enter
value...")
szValue = PathToFileName$(szValue)
szValue = Left$(szValue, Len(szValue) - 4)
Note "Value entered was: " & szValue
Select * From MYTABLE Where MYCOLUMN = szValue Into CUR__QUERY NoSelect

Undim szValue
***************************************************

To test this in the real world to the following:
1. Copy the text wihtin the "stars" to a empty file that you save as
somename.wor
2. Change the name of the table and the column to be one you have.
3. Make sure that this table is open when you open the workspace, you could
add the "Open table ..." statement at the top of the workspace after "Dim
szValue..."
4. Save the file
5. Open the workspace in MapInfo

But I'm convinced that his would be much better to build into a specific
MapBasic application - or some other sort of application - where you can
control whatever value is returned much better than it's possible here.

But anyway give it a try.

Peter Horsb�ll M�ller
GIS Developer
Geographical Information & IT
 
COWI A/S
Rug�rdsvej 55
DK-5000 Odense
Denmark
 
Tel     +45 6313 5013
Direct  +45 6313 5008
Mob     +45 5156 1045
Fax     +45 6313 5090
E-mail  [EMAIL PROTECTED]
http://www.cowi.dk
COWI GIS konference afvikles i dagene d. 2.-3. september.
Se yderligere oplysninger p�  www.cowi.dk/Div04/Profiles/nyheder.asp



> -----Original Message-----
> From: Matt Bolton [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, July 02, 2003 4:22 AM
> To: MI-L
> Subject: MI-L Prompting user for Parameters
> 
> 
> Hi all,
> 
> I'm sure if this can be done it's really simple, but I just 
> can't crack it. Is it possible (without using MapBasic) to 
> open a Mapinfo query or a 
> DBMS table and have the user prompted for values. Ideally I'd like to 
> set up a DBMS linked table so that whenever the data is 
> refreshed, the 
> user is prompted for input and the data returned is based on 
> that (e.g. 
> only records dated after the entered date).
> My current work-around is that the user has to open the 
> Access database 
> and enter the parameters in a table or form which the .TAB 
> uses in its 
> query, but I'd prefer to do it all from MI if possible.
> 
> Thanks,
> 
> Matt
> 
> -- 
> Matt Bolton
>  
> Mach 3 IT 
> 
> Mobile 0412 122 416
> Email  [EMAIL PROTECTED]
> 
> 
> 
> 
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | 
> www.directionsmag.com | To unsubscribe, e-mail: 
> [EMAIL PROTECTED]
> For additional commands, e-mail: 
> [EMAIL PROTECTED]
> Message number: 7452
> 

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 7454

Reply via email to