 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Oct 23, 2009 3:39 pm |
No, I really don't want to do this. This makes the trigger parser much more complicated. I'd rather that people stick with the traditional method of using () in the pattern to capture the substring, and then assign it using: varname=%1 in the script. That actually makes your script a bit faster since the variable assignment reference gets compiled, whereas with the embedded variable in the trigger pattern it doesn't.
In other words, when you do this:
#TRIGGER {whatever (%w) test} {varname = %1}
the lookup of the @varname reference is done *once* at compile time, making the trigger execute faster. Compared to this:
#TRIGGER {whatever &%wvarname test} {#noop}
where the lookup of the @varname reference is done at runtime each time the trigger fires.
Also, you can already use the regular expression syntax to accomplish what you want:
#REGEX {whatever (?varname:[\w\s])} {#noop}
I think that is the regex syntax for assigning a subpattern to a varname, but someone can correct me if I've got it wrong.
Anyway...bottom line is that I'd rather see people encouraged to use standard pattern syntax and then do their variable assignments in the script. It's faster and easier to support and debug too. |
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|