Thank you to all who responded to my original post on how to call only a
particular subroutine in an mbx (see original below).  Unfortunately, I have
not had a chance to test all of them out but I wanted to summarize because
if I wait too long, I'd forget to do it!

The simple answer is that what I was seeking could not be done the way I had
hoped.  But there are some good approaches worth trying:

1) use the getcommandline API call
2) do it in two programs - one that creates a text file with the name of the
subroutine and any parameters, then a second that reads in that text file to
mapbasic and executes accordingly
3) use DDE or OLE (for example, though VB) to control the MapBasic program

Simply because of my own comfort level, #2 will work best for us.

Thanks to Peter Horsb�ll M�ller, Bill Thoen, Robert Crossley, Phil Waight,
Gary Searles, and Martin Hodder for all their guidance.

Darrin
-----Original Message-----
From: Darrin Clement [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 19, 2005 2:09 PM
To: 'Robert Crossley'
Cc: 'MapInfo List'
Subject: RE: MI-L running mbx from command prompt

Our code is indeed MapBasic and the passing of parameters isn't really the
issue (we know that part).  It's that we want to be able, from a dos batch
script, to call specific subroutines of the mapbasic code.  If each sub were
it's own .mbx, this would be no problem.  But since there are ~20 different
subs in the .mbx, we would like to be able to call just the right one from
DOS.

One idea we have is to actually pass the name of the subroutine as a
parameter of main - but that seems to violate basic programming rules.

If anyone has further insight, please let me know and I will summarize for
the group if there is a solution.

Thank you.

Darrin
www.maponics.com 

On Mon, 18 Apr 2005 09:12:37 -0400, Darrin Clement  
<[EMAIL PROTECTED]> wrote:

>  Hello,
>
> We have a complex piece of code that generates a button pad.  When the
> user
> then selects a button, it calls the appropriate subroutine procedure  
> which
> then prompts for a few input parameters.
>
> Is there a way to call such a subroutine (procedure), while passing 
> the input parameters, from the command line?  Maybe using switches or
> something?
> For example:
>
> Run testprogram.mbx /subroutine1(input1,input2)
>
> I'm not really asking about the passing of parameters but more the act 
> of calling a subroutine from a command line.  Any help?
>
> Thank you!
>
> Darrin
>
>
>
> ..........
>
> www.maponics.com   www.maponicsonlinestore.com 
> C 2005.  Note: The information contained in this message is privileged
> and
> confidential and may be protected from disclosure and forwarding. If the
> reader of this message is not the intended recipient, or an employee or
> agent responsible for delivering this message to the intended recipient,  
> you
> are hereby notified that any dissemination, distribution or copying of  
> this
> communication is strictly prohibited. If you have received this
> communication in error, please notify us immediately by replying to the
> sender named above and deleting this message from your computer. Thank  
> you.



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

Reply via email to