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


Joined: 04 Mar 2005
Posts: 10

PostPosted: Wed Nov 08, 2006 12:51 pm   

How to get the number in a string list ?
 
@mylist contains {a|b|c|d|e|f|g}, so 'e' is the 5th. How to get the number of '5', which is the place in string list ?
Reply with quote
Mixsel
Wanderer


Joined: 02 Feb 2003
Posts: 99
Location: Seattle, Wa

PostPosted: Wed Nov 08, 2006 1:04 pm   
 
Hmm can try #echo @mylist.5

theres others ways to utilize stringlist just woke up so that should get ya started :)
_________________
Spin
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Wed Nov 08, 2006 1:53 pm   
 
%ismember("e",@mylist)
_________________
Taz :)
Reply with quote
thd
Beginner


Joined: 04 Mar 2005
Posts: 10

PostPosted: Thu Nov 09, 2006 1:42 am   
 
Taz wrote:
%ismember("e",@mylist)


oh, forgot this one, thanks :)
Reply with quote
mikele
Beginner


Joined: 10 Nov 2006
Posts: 20
Location: China

PostPosted: Fri Nov 10, 2006 6:43 am   
 
#var number 0
#forall @mylist {#add number 1;#if %i=e {@number is that you want}}
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Fri Nov 10, 2006 9:07 am   
 
mikele that would certainly work but would be much slower than using the inbuilt %ismember function.
_________________
Taz :)
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