Topic: Arguments in command line execution? (1 of 5), Read 25 times
Conf: Startup, File Open, Exit
From: Mark Novembrino
Date: Thursday, March 31, 2005 03:24 PM

Is there a way to pass information to a vedit macro when starting the macro from a command line?

For example, let's say I'm starting MyMacro.vdm this way:

c:\vedit\vpw -x c:\MyMacros\MyMacro.vdm

And let's say my macro processes a list of files in a certain directory. But I don't know the directory (it changes each time) and I don't want to ask for user input when the macro runs. Instead, what I'd rather do is pass the macro something like this:

c:\vedit\vpw -x c:\MyMacros\MyMacro.vdm c:\directory_to_process

The reason I need to do this is because I'm launching the Vedit macro from another program. I want it to be a seamless process (i.e., one program passes the directory argument to vedit and the vedit macro runs without user input) rather than asking the user to select the directory from within vedit.

- Mark Novembrino

 


Topic: Re: Arguments in command line execution? (2 of 5), Read 23 times
Conf: Startup, File Open, Exit
From: Ted Green
Date: Thursday, March 31, 2005 04:32 PM

At 03:24 PM 3/31/2005, you wrote:
>Is there a way to pass information to a vedit macro when starting the macro from a command line?

Yes. After any options and filenames, specify "-u" and anything after it that you like. (In other words, the invocation processing stops on "-u".)

Since the string variable CMD_LINE contains the entire invocation line, you can insert it into a buffer, search for "-u" and handle anything after it any way you like.)

See the compdir.vdm macro for an example.

Ted.

 


Topic: Re: Arguments in command line execution? (3 of 5), Read 23 times
Conf: Startup, File Open, Exit
From: Christian Ziemski
Date: Thursday, March 31, 2005 04:50 PM

On Thu, 31 Mar 2005 15:24:00 -0500, Mark Novembrino wrote:

> Is there a way to pass information to a vedit macro when starting
> the macro from a command line?
> ...
> c:\vedit\vpw -x c:\MyMacros\MyMacro.vdm c:\directory_to_process


I do these things like so:

c:\vedit\vpw -c "Reg_Set(103, 'c:\directory_to_process')" -x
c:\MyMacros\MyMacro.vdm

MyMacro.vdm then is able to access Text Register 103 (for example)
with the desired contents.


Christian

 


Topic: Re: Arguments in command line execution? (4 of 5), Read 26 times
Conf: Startup, File Open, Exit
From: Ted Green
Date: Thursday, March 31, 2005 05:03 PM

At 04:51 PM 3/31/2005, you wrote:
>I do these things like so:
>
>c:\vedit\vpw -c "Reg_Set(103, 'c:\directory_to_process')" -x
>c:\MyMacros\MyMacro.vdm
>
>MyMacro.vdm then is able to access Text Register 103 (for example)
>with the desired contents.

That certainly is another (clever) way to pass a parameter.

Ted.

 


Topic: Re: Arguments in command line execution? (5 of 5), Read 18 times
Conf: Startup, File Open, Exit
From: Mark Novembrino
Date: Friday, April 08, 2005 09:52 PM


Thank you. I tried this, and it worked great.

On 3/31/2005 5:03:10 PM, Ted Green wrote:
>At 04:51 PM 3/31/2005, you
>wrote:
>>I do these things like so:
>>
>>c:\vedit\vpw -c "Reg_Set(103, 'c:\directory_to_process')" -x
>>c:\MyMacros\MyMacro.vdm
>>
>>MyMacro.vdm then is able to access Text Register 103 (for example)
>>with the desired contents.
>
>That certainly is another
>(clever) way to pass a
>parameter.
>
>Ted.
>