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
xiangwei
Beginner


Joined: 17 Apr 2004
Posts: 18

PostPosted: Mon Jun 04, 2007 11:31 am   

help me thanks
 
how do what list=2|3|2|3|4|4|5|2|5|5|6|7
#show xxx(2,@list) or xxx(@list,2)
Displays: 1|3|8
i dont know xxx=what?

pls tell me thanks
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Mon Jun 04, 2007 2:31 pm   
 
Your question was a little confusing at first but I think I understand what you mean. Unfortunately there is no single function that does what you want.

Your closest bet would be %ismember which will return the first one. Perhaps the easiest to simulate the behavior you want is with a #FORALL loop. Try this.

Code:
#VAR Count 0
#VAR test "2"
#FORALL @list {#ADD Count 1;#IF (@test =="%i") {#ADDITEM Found @Count }}
#SHOW @Found


The code's untested but should work. Either way you get the general idea.
_________________
Asati di tempari!
Reply with quote
xiangwei
Beginner


Joined: 17 Apr 2004
Posts: 18

PostPosted: Mon Jun 04, 2007 11:12 pm   
 
Thank you, this is what I need
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