Hello,
I have
Macro.exe /Force=2 /Mass=3
and I need to find out the name that is passed as a variable.
eg. Force and Mass
In my macro I can retrieve the values by using
Send>%Force%
or
Send>%Mass%
but now I want the
Send>%VariableName% = %Force%
instead.
How do I find out the variable name?
Ben
Retrieve variable name passed as a command line parameter
Moderators: Dorian (MJT support), JRL
The parameters show up in the "Command_Line" system variable so its possible to separate them out without having to declare them as an additional parameter.
Try this:
Try this:
Code: Select all
//Remove spaces from the command line to be sure there are
//no extra spaces in the parameters section
StringReplace>command_line, ,,param_line
//Isolate the parameters. parameter_count-1
//will be the number of parameters
Separate>param_line,/,parameter
//Use a loop to separate each parameter name
//from each parameter value
Let>p_count=1
Repeat>p_count
Add>p_count,1
Let>value=Parameter_%p_count%
Separate>value,=,segment
//Segment_1 is the parameter name
//Segment_2 is the parameter value
MDL>%segment_1%=%segment_2%
Until>p_count=parameter_count
Re: Retrieve variable name passed as a command line paramete
How do I find out the variable name?
watson
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Retrieve variable name passed as a command line paramete
kiohaa wrote:How do I find out the variable name?
JRL wrote://Segment_1 is the parameter name
//Segment_2 is the parameter value
MDL>%segment_1%=%segment_2%
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?