Macro> command can't take a Let variable?
Moderators: JRL, Dorian (MJT support)
Macro> command can't take a Let variable?
I have a somewhat long list of values and parameters to pass into another macro that I want to call using the Macro> command.
Thus, I want to use some concatenating and set this to a Let> variable and than pass that variable into the Macro> command
However, this Macro> command doesn't like unless it's direct and no variables.
Any help or news that this will be fixed in the future?
Thanks.
Thus, I want to use some concatenating and set this to a Let> variable and than pass that variable into the Macro> command
However, this Macro> command doesn't like unless it's direct and no variables.
Any help or news that this will be fixed in the future?
Thanks.
[MyMainScript.scp]
ConCatVar: A;B;C;D;E
Btw: what about to use an INI file instead ?!
[MyOtherScript.scp]Let>string = A
Let>string2 = ;B
Let>string3 = ;C
Let>string4 = ;D
Let>string5 = ;E
ConCat>string,%string2%
ConCat>string,%string3%
ConCat>string,%string4%
ConCat>string,%string5%
Macro>MyOtherScript.scp /string=%string%
Outcome should be:MessageModal>ConCatVar: %string%
ConCatVar: A;B;C;D;E
Btw: what about to use an INI file instead ?!
Nope, concat still doesn't work on the Macro> command
I tried Concat> and the methods you showed above.
Nevertheless, the error message reads like it's supposed to read, that is, the command with parameters, but it still says it, the macro, doesn't exist.
It seems like you can't use variables declared elsewhere for the Macro> command.
Any ideas why the Macro> command doens't like variables?
Nevertheless, the error message reads like it's supposed to read, that is, the command with parameters, but it still says it, the macro, doesn't exist.
It seems like you can't use variables declared elsewhere for the Macro> command.
Any ideas why the Macro> command doens't like variables?
Macro>file_name [/variable=value|variable [/variable=value|variable] ... ]
Executes another script file. file_name must be a filename of a macro file. For macros that appear in Macro Scheduler's control panel, add '.scp' to the end of the macro name. It is also advisable to specify the full path should the path change during the execution of the calling macro.

Executes another script file. file_name must be a filename of a macro file. For macros that appear in Macro Scheduler's control panel, add '.scp' to the end of the macro name. It is also advisable to specify the full path should the path change during the execution of the calling macro.
Let>string = A
Let>string2 = ;B
Let>string3 = ;C
Let>string4 = ;D
Let>string5 = ;E
ConCat>string,%string2%
ConCat>string,%string3%
ConCat>string,%string4%
ConCat>string,%string5%
MessageModal>%string%
Macro>C:\MyPath\MyOtherScript.scp /string=%string%

SPOKE TOO SOON.....
Seems like any parameter after the 1st parameter are not interpreted at variables.
Thus, strings 2, 3, 4, and so on are not even variables to begin with, even though declared correctly, and thus are not even passed as variables while though the 1st one is.
This parameter thing seems broken.
Thus, strings 2, 3, 4, and so on are not even variables to begin with, even though declared correctly, and thus are not even passed as variables while though the 1st one is.
This parameter thing seems broken.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Just a reminder that the macro being called must already have the incoming variables declared, not just the first one.
And you will need format something like:
And you will need format something like:
Macro>C:\MyPath\MyOtherScript.scp /string1=%string1% /string2=%string2% /string3=%string3%
Last edited by Bob Hansen on Wed Sep 29, 2004 4:12 pm, edited 1 time in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
declare where?
Where should these variable be declared?
IF these variable are to declared inside the Macro being called, how will one be able to pass in new values to begin with as aren't the new values passed in at the very beginning of the script?
And if these variables are to be declared in the calling script, they don't seem to be working as I believe I tried it like you illustated before.
IF these variable are to declared inside the Macro being called, how will one be able to pass in new values to begin with as aren't the new values passed in at the very beginning of the script?
And if these variables are to be declared in the calling script, they don't seem to be working as I believe I tried it like you illustated before.
seems to be working now
Ok, I see what I was going wrong, seems to be ok now. Thanks.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
please, more clarification..
Hi, I know this thread is old, but I'm having the same problem.
rh2001, (or anybody else) were you able to pass multiple variables between macros successfully? Or did you concatenate ?
-Ethan
rh2001, (or anybody else) were you able to pass multiple variables between macros successfully? Or did you concatenate ?
-Ethan
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
An untested modification to my earlier response:
Contents of first script file:
Contents of first script file:
In this case, the macro MyOtherScript.scp must already have the three variables string1, string2, and string3 in the script. Can do that at the begining of MyOtherScript.scp like this:Let>variable1=ValueForString1
Let>variable2=ValueForString2
Let>variable3=ValueForString3
Macro>C:\MyPath\MyOtherScript.scp /string1=%variable1% /string2=%variable2% /string3=%variable3%
Thanks to Support for catching that......//The next three lines from my original posting are a bad example, would erase incoming values, as noted by support in subsequent message
//Let>string1=
//Let>string2=
//Let>string3=
//This next line should be OK. Was added as an edit after Support's catch.
MessageModal>First value coming in is %string1%.%CRLF%Second value coming in is %string2%.%CRLF%Third value coming in is %string3%.
//Do other stuff in the script.....
Last edited by Bob Hansen on Wed Dec 01, 2004 11:24 pm, edited 1 time in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Bob,
Your example won't work because you are setting the values of the passed variables to nothing. So what you pass in is obliterated.
Macro>%SCRIPT_DIR%\othermacro.scp /var1=fred /var2=sally
othermacro.scp:
MessageModal>Hello %var1% and %var2%
You don't want to be reinitialising the passed variables at the start of the script or the values you pass in will be overwritten.
Your example won't work because you are setting the values of the passed variables to nothing. So what you pass in is obliterated.
Macro>%SCRIPT_DIR%\othermacro.scp /var1=fred /var2=sally
othermacro.scp:
MessageModal>Hello %var1% and %var2%
You don't want to be reinitialising the passed variables at the start of the script or the values you pass in will be overwritten.
MJT Net Support
[email protected]
[email protected]
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
You're right.....thanks for catching that.... a poor example of having them in the receiving script. That's what I get for working with too many languages at the same time.
The original example has been modifed.
The original example has been modifed.
Last edited by Bob Hansen on Wed Dec 01, 2004 11:25 pm, edited 1 time in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!