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
TarkenKalia
Newbie


Joined: 25 Jan 2008
Posts: 7

PostPosted: Wed Jul 16, 2008 1:50 pm   

Using %pos
 
Ok what I'm trying to accomplish is a queue system. If for some reason, something needs to be taken out of the queue, i need to interact with 2 variables. One contains names, the other contains any of 3 different choices, so I need to find the position of a name in the first string. The issue is, when I use %pos, it counts the |'s used to separate values in a string. Is there a way I can avoid this so I can get the position number?

#var test {A|B|C|D|E|F|G}
#show %pos(F,@test)

yields 11...which it should be 6
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Wed Jul 16, 2008 1:56 pm   
 
%pos is for strings
try %ismember for string lists
Code:
#show %ismember(F,@test)


that yields 6
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
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