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


Joined: 17 Feb 2002
Posts: 4
Location: USA

PostPosted: Fri Mar 08, 2002 5:46 am   

Adding items in a list
 
Is there any possible way to add the contents of a string list into one variable?

I have a variable that contains
15|16|17|15|20|18|18|19|20

and I want to add each of the numbers to a total and store it in another variable.

Any suggestions?

Onys
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Fri Mar 08, 2002 6:31 am   
 
#VAR sum 0
#VAR theNumbers {15|16|17|15|20|18|18|19|20}
#FORALL @theNumbers {#ADD sum %i}

Troubadour
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