|
myrison Beginner
Joined: 10 Nov 2006 Posts: 22
|
Posted: Mon Oct 29, 2007 7:30 pm
Variable Expansion in #SUB Trigger |
Hi all,
I am having trouble with writing a trigger that creates a #SUB command. Within the #SUB command, I want to expand a variable from a varlist that is kept in ZMUD, but all I can get it to do is return the literal results (i.e. @variable instead of the variable value).
Info:
@varlist; list the vars are stored in (included items are text only)
@temp_var; temporary storage of the current variable to create the trigger
Code: |
#LOOP (%numitems( @varlist)) {
#VAR temp_var {%item( @varlist, %i)} {_nodef} {CLASSNAME}
#trigger {@tempvar} {#SUB {@tempvar TEST TEXT TO SUB}}
}
|
The idea is to just run this alias once to create a list of substitute triggers from a huge list of variables I now have in the list. However, I cannot get the @tempvar to expand in either the trigger pattern or the trigger value. I have tried using @{@tmpvar} as well with no success.
What results from the above is this trigger:
Pattern: @tempvar
Value: #SUB {@tempvar TEST TEXT TO SUB}
If I can get the variables to expand in both places before trigger is created I will have what I need.
Help appreciated. Thank you in advance. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Mon Oct 29, 2007 7:43 pm |
Why not just use the ability of triggers to make use of the list directly?
#TRIGGER {({@varlist})} {#SUB {%1 TEST TEXT TO SUB}} |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
myrison Beginner
Joined: 10 Nov 2006 Posts: 22
|
Posted: Mon Oct 29, 2007 7:59 pm |
Vijilante wrote: |
Why not just use the ability of triggers to make use of the list directly?
#TRIGGER {({@varlist})} {#SUB {%1 TEST TEXT TO SUB}} |
Obviously a case of a super over-complication of something rather simple. :-) May thanks Vijilante... problem solved, and quite neatly. |
|
|
|
|
|