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
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Thu Jun 17, 2004 6:31 pm   

Best way to get the count number in Variable
 
I have a variable that holds a number of values:
#var imput bread|eggs|milk|sausage|butter

What I want to do is be about to list the items by count number:
This output:
You have bread in @input.1
You have eggs in @input.2
You have milk in @input.3
You have sausage in @input.4
You have butter in @input.5

I tried a #FORALL @input {}, but I can't get it to count the list items. correctly because that forall is inside another forall.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Thu Jun 17, 2004 7:53 pm   
 
Use %i for the first Loop/forall use %j for the first nested one and use %k for the second nested etc.

Also for future refrence it sometimes helps to post the script that you have so we know exactly what you are trying to do and quite possibly give you pointers on how to make it better.
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