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
adamwalker
Apprentice


Joined: 12 Mar 2005
Posts: 195

PostPosted: Wed Mar 15, 2006 2:38 pm   

number of item in a list?
 
question that i cant work out how to do...

i have a @variablelist

eg

@variablelist = red|blue|green|dog|monkey|bannana

and i have a variable called @pickme

what i want to do is IF @pickme %ismember @variablelist then delete it from the list.. and the item after it...

SO...

#if (%ismember( @pickme, @variablelist)) {#deli @pickme @variablelist;and delete the next item}

so if @pickme = dog. both dog and monkey get deleted.

thanks for your help guys!
Reply with quote
JQuilici
Adept


Joined: 21 Sep 2005
Posts: 250
Location: Austin, TX

PostPosted: Wed Mar 15, 2006 3:20 pm   
 
%ismember will give you the item number if the item is in the list. See the %ismember help page for details.

So...just capture the return value from %ismember. If it's nonzero, delete that item number twice.
_________________
Come visit Mozart Mud...and tell an imm that Aerith sent you!
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