Some years ago I build a MapInfoDDE application in VB. The only purpose of this application was to pass on commands to a MapBasic application.
So what I could do with this application was to start it with a number of parameters and these parameters would be passed on to the MapBasic application. If the application wasn't running it would be started. Something like this: MapInfoDDE.exe /searchtab=roads /searchcol=roadname /find=1 Global View /zoom=1000 The application would send on these parameters to the mapBasic application where they would be captured in the RemoteMessageHandler. The logic is then to be made in the MapBasic application. I guess this is kind of what you were looking for Peter Horsb�ll M�ller GIS Developer Geographical Information & IT COWI A/S Odensevej 95 DK-5260 Odense S. Denmark Tel +45 6311 4900 Direct +45 6311 4908 Mob +45 5156 1045 Fax +45 6311 4949 E-mail [EMAIL PROTECTED] http://www.cowi.dk/gis -----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 Thanks Robert, Phil, and Bill, 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 -----Original Message----- From: Robert Crossley [mailto:[EMAIL PROTECTED] Sent: Monday, April 18, 2005 8:01 PM To: Darrin Clement Cc: MapInfo List Subject: Re: MI-L running mbx from command prompt Darrin, I take it the complex piece of code is not in mapBasic? If it is you can call any subroutine with paramters by using the ByVal reference. Sub YourSubProcedure(ByVal input1 as String, input2 As String) I have run mapbasic programs from the command line from VB by writing an ini file first, and then just calling the mbx from the command line (this will allow other machines to run the mbx if needed). The first thing the Mapbasic program does is read the ini file for its data. You can use the windows API's to read and write the ini files. No doubt we will be able to do this with xml docs once the tools are in, but for now there are more tools to read and write ini files. r 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 > 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: 16125 > > -- ________________________________________________ Robert Crossley Agtrix P/L 9 Short St PO Box 63 New Brighton 2483 Far Southern Queensland AUSTRALIA 153.549004 E 28.517344 S P: 02 6680 1309 F: 02 6680 5214 M: 0419 718 642 E: [EMAIL PROTECTED] W: www.agtrix.com W: www.wotzhere.com skype: robertcrossley --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 16136 --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 16142 --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 16143
