 |
Hazram Wanderer
Joined: 24 May 2005 Posts: 71
|
Posted: Sat Jul 30, 2011 1:17 am
Local vars in multi-state triggers? |
Is it possible to use local variables in multi-state triggers, preserving them across state changes? I'm not sure about the actual scoping of these persistent but segmented objects, or how to incorporate the variable definitions into the xml.
|
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4769 Location: Pensacola, FL, USA
|
Posted: Sat Jul 30, 2011 1:30 am |
well.. yes and no
local variables will need to be redefined in each state they get used in, but with the %t1-%t99 variables, you should be able to access the various patterns from previous states |
|
_________________ Discord: Shalimarwildcat |
|
|
 |
Hazram Wanderer
Joined: 24 May 2005 Posts: 71
|
Posted: Sat Jul 30, 2011 1:51 am |
the %t1-99 variables are what I'm after. Won't they get overwritten by backreferences in each successive state?
For example, pattern1 matches "foo" and saves to %t1.
Then pattern2 matches "bar" - will this be saved to %t2, or overwrite %t1? |
|
|
 |
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Sat Jul 30, 2011 1:53 am |
The %t# variables are cumulative. If you have 3 wildcards in the first state, the first wildcard in the second state will be saved to %t4 (and %1, within that state).
|
|
|
 |
Hazram Wanderer
Joined: 24 May 2005 Posts: 71
|
Posted: Sat Jul 30, 2011 1:57 am |
Thanks. I read about the %t vars in the helpfile, but didn't understand it right away, and couldn't find the reference again.
|
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4769 Location: Pensacola, FL, USA
|
Posted: Sat Jul 30, 2011 2:14 am |
its in the predefined variables section... there is a link to it on #HELP #TRIGGER, or you can search for it
|
|
_________________ Discord: Shalimarwildcat |
|
|
 |
Hazram Wanderer
Joined: 24 May 2005 Posts: 71
|
Posted: Sat Jul 30, 2011 2:19 am |
found it, thanks again.
|
|
|
 |
|
|