User avatar
simonmason
Is there life beyond myServer?
Is there life beyond myServer?
Posts: 1224
Joined: Tue Dec 26, 2006 9:06 pm
Contact: Send private message

Macro parameter help

Sun Apr 16, 2017 10:22 pm

I am trying to create a Command Macro that accepts a parameter.

I have called the macro Sirius.PlayChannel and I want it to execute the external program sirius.exe with a parameter that I pass it. For example - if I call Sirius.PlayChannel~36 I want it to Run the program sirius.exe and pass it 36 as a parameter.

I have tried a number of versions of the macro but none seem to work. I have tried:

Run|sirius.exe <p1>
Run|sirius.exe~<p1>
etc.

What is the correct format?

sirius.exe is in the Myserver main folder. I have another test command macro setup with Run|sirius.exe~36 and it passes the 36 to sirius.exe and works fine. Obviously I am missing something here?? Thanks.
Simon D. S. Mason

Synergy_Tech
Intermediate
Intermediate
Posts: 310
Joined: Wed Sep 26, 2012 9:36 pm
Contact: Send private message

Re: Macro parameter help

Wed Apr 19, 2017 11:12 pm

Where is the parameter being called from?

User avatar
DavidL
Founder
Founder
Posts: 11909
Joined: Sat Feb 08, 2003 9:39 am
Location: Metamora, Michigan
Contact: Send private message

Re: Macro parameter help

Thu Apr 20, 2017 12:03 pm

<<>> Double Arrows Double surrounding arrows are used to signify variables local to the application/client instance.

Is that what you are trying to do?

http://allonis.com/template-features/pr ... mmand.html

User avatar
simonmason
Is there life beyond myServer?
Is there life beyond myServer?
Posts: 1224
Joined: Tue Dec 26, 2006 9:06 pm
Contact: Send private message

Re: Macro parameter help

Sun Apr 23, 2017 7:53 am

I am not sure if this is the same thing, although I have developed a workaround to my issue which is definitely less elegant.

I was trying to call command macros on the server from the client with a parameter. My issue was with getting the right syntax to make it execute. The window for editing macros on the server says "When creating new macros enter one Server Command per line. Macro syntax will automatically be inserted when saved or collapsed. If your Macro accepts parameters then insert parameters using <P1>,<P2>,<Pn> syntax.

Let's say I have a command macro, "Sample.Macro" and it executes one command "do command".

Normally I would call it with "sample.macro" and it would run.

Now let's say the command takes a parameter - "do command <P1>"

I tried calling it in a number of different ways but none of them pass the parameter, for example if I was trying to pass it the number 1:

"sample.macro~1" - nothing happens
"sample.macro" - the macro runs with no parameter
"sample.macro 1" - nothing happens

Thanks.
Simon D. S. Mason

User avatar
AllonisDave
Founder
Founder
Posts: 11604
Joined: Fri Feb 07, 2003 8:56 am
Location: Newport Beach, CA
Contact: Send private message

Re: Macro parameter help

Tue May 23, 2017 8:16 pm

usage is
sample.macro|p1value~p2value~p3value etc..

Inside the macro
p1value is <P1>
p2value is <P2>
p3valus is <P3>

etc.

Art Dustman
Expert
Expert
Posts: 614
Joined: Fri Nov 10, 2006 3:22 pm
Location: NJ
Contact: Send private message

Re: Macro parameter help

Thu Jan 31, 2019 8:54 pm

That is awesome. Just discovered this. Saves so much nonsense code!

Return to “Advanced Techniques”

Who is online

Users browsing this forum: No registered users and 1 guest