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
AzCowboy
Adept


Joined: 09 Nov 2000
Posts: 222
Location: USA

PostPosted: Mon Aug 26, 2002 8:12 pm   

substring of a variable
 
Ok, I have a variable named status which contains something like:

(sleep)(w)(th)(hu)

Is there an easy way to test to see if it contains a certain string? (like sleep)

I thought there was a function for this, but now I can't find it in the help file.

Thanx,
AzCowboy
Reply with quote
Tarn
GURU


Joined: 10 Oct 2000
Posts: 873
Location: USA

PostPosted: Mon Aug 26, 2002 8:42 pm   
 
quote:

Is there an easy way to test to see if it contains a certain string? (like sleep)



Pos() is what you're looking for. Excerpt from the help file attached.

-Tarn


pos
Syntax: %pos(p,s)
return the position of pattern p in string s. Return 0/false if not found

Examples:

#SHOW %pos(ABC,12AB56ABC10ABC)
displays: 7
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