You can't pass parameters to a main, as far as I am aware, but you can pick
up the parameters when mapInfo was run. Eg "c:\mapinfo\mapinfo.exe
c:\mapinfo\myapp.mbx john johnspassword". (Although this does have the
effect of leaving a nasty stain on the MRU).

The API to do this is:

Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineA" () As
String



Carl Nunn
- ALIGNED ASSETS   -   telephone: 01483 306 210  -  web:
www.aligned-assets.co.uk

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of David J Jerrard
Sent: 18 August 1999 00:24
To: [EMAIL PROTECTED]
Subject: MI - Command line parameters?


Hi all,

I think I know the answer to this one already, but I have learned never to
pre-empt the knowledge of the list!

Is it possible to pass command-line parameters to an MBX?  e.g. "Run
Application
Myapp.MBX  1  Hello  3.5"

As a bit of a dabble I tried "parameterising" the Main sub:

     declare sub Main(byval param1as Integer)

... but MapBasic didn't fall for it.

Any thoughts gratefully received.

Cheers,
David Jerrard.




*************************************************************
Opinions contained in this e-mail do not necessarily reflect
the opinions of the Queensland Department of Main Roads, or
of Queensland Transport. If you have received this electronic
mail message in error, please immediately notify the sender
and delete the message from your computer.

----------------------------------------------------------------------
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]

Reply via email to