 |
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Tue Dec 04, 2007 11:57 pm
[2.14a] Question about CMUD Argument passing |
I used to use quotes to group arguments with white space that needed to be passed to other aliases. In CMUD it doesn't evaluate them in quotes. Is there a way to group the arguments together (which contain white space) so that they are passed as one argument containing white space?
An example is shown below where I pass FirstArgument as the first argument and "Second: %1" as the second. Is there a way to group it together but to have it evaluate the %1 so it passes it correctly?
<class name="test" id="9">
<alias name="fun" id="10">
<value>fun2 FirstArgument SecondArgument %1</value>
</alias>
<alias name="fun2" id="11">
<value>#say First: %1 ---- "Second: %2"</value>
</alias>
</class>
Result:
========================
Execute:
fun hello
Result:
First: FirstArgument ---- Second: %2 |
|
|
|
 |
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Wed Dec 05, 2007 1:21 am |
Found the answer, brackets {} are the way to do this. Groups text with white space but allows %1 to be substituted.
|
|
|
|
 |
Larkin Wizard

Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Wed Dec 05, 2007 12:14 pm |
You could also concatenate the string, like so:
| Code: |
<class name="test" id="1">
<alias name="fun" id="2">
<value>fun2 FirstArgument "SecondArgument "%1</value>
</alias>
<alias name="fun2" id="3">
<value>#say First: %1 ---- Second: %2</value>
</alias>
</class> |
|
|
|
|
 |
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Wed Dec 05, 2007 9:53 pm |
Yep, another good way of doing it, thanks Larkin.
|
|
|
|
 |
|
|
|