Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Shilong
Newbie


Joined: 27 Oct 2004
Posts: 2

PostPosted: 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
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: 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
Reply with quote
Shilong
Newbie


Joined: 27 Oct 2004
Posts: 2

PostPosted: Sat Feb 05, 2005 9:49 pm   
 
thank you much, I can stop scanning the help thing that came with zmud now Very Happy
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net