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
Duindain
Novice


Joined: 14 Feb 2003
Posts: 31
Location: Perth, Australia

PostPosted: Sat Aug 21, 2004 6:20 pm   

short trigger not sure whats backwards on it
 
#forall @doing {#loo 5 {#var @manathem=%ADDITEM( (%item( @doing, %i)), @manathem)}}

ok simple trigger goes thru a sting list one element at a time for each item in list it places into a new list 5 times when i run it it just doesnt seem to work prolly got one of the elements backwards

@doing is orginal string list
@manathem is the enlarged duplicated list
any help would be good
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Sat Aug 21, 2004 6:36 pm   
 
The problem is that both the #FORALL and #LOOP commands use %i. By nesting them like this, %i maintains the value of the #FORALL loop, so the %item function isn't working right (the second value is the current element of @doing instead of the number value from #LOOP).

Also, you have 2 syntax errors with your #VAR command: don't use the @ symbol when assigning a value, and don't use the = when assigning via #VAR. IOW, the syntax is either "#VAR variablename {variable value" or "variablename = {variable value".

I believe this will accomplish what you want:
Quote:
#FORALL @doing {#LOOP 5 {#VAR manathem %additem(%i,@manathem)}}
_________________
.geniusclown
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