|
Shilong Newbie
Joined: 27 Oct 2004 Posts: 2
|
Posted: Sat Feb 05, 2005 9:40 pm
using a trigger pattern for a #if test case |
so I want to be able to execute a segment of code using a trigger patter for the test case of a #if statement. I can't for the life of me figure out how to do this. I assume that it would involve something like this:
#if (#trigger [yada yada yada]) {do something}
I just keep getting syntax errors when I write the code. Any help would be awsome.
Thanks in advance
Shilong |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Feb 05, 2005 9:48 pm |
Nope, but you have two options:
#if ("string to be tested" ~= "pattern to test for") {} {}
#if (%match("string to be tested","pattern to test for")) {} {}
%match() also allows you to directly fill variables with captured information, so it's very convenient if you know the pattern will match and merely need to extract the information (thus no need for an #IF command). |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Shilong Newbie
Joined: 27 Oct 2004 Posts: 2
|
Posted: Sat Feb 05, 2005 9:49 pm |
thank you much, I can stop scanning the help thing that came with zmud now
|
|
|
|
|
|