|
user0101 Apprentice
Joined: 01 Aug 2003 Posts: 100 Location: USA
|
Posted: Fri Jan 02, 2004 3:29 am
Executing everything in a list |
I don't have any specific examples, because this is just an idea I had and wasn't sure if it is possible. Let's say for the sake of argument that @stringlist is a string-list that contains aliases. I want everything in the string-list to be executed and deleted from the stringlist immediately after.
#forall @stringlist {%item(@stringlist, %i);#delitem stringlist %i}
amount=%numitems(@stringlist)
#LOOP @amount {%item( @stringlist, @index);#add index 1}
index=1
Both don't work. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Jan 02, 2004 5:02 am |
quote:
#forall @stringlist {%item(@stringlist, %i);#delitem stringlist %i}
You weren't far off on this one. #FORALL's %i is the actual element value itself (ie, if the first item in your list was 'dofighting' then %i = 'dofighting'). When you tried to use it in the %item() function, it was expanded to %item(@stringlist, dofighting), and ZMud just doesn't know what to do with that since it expects a number as the second parameter for %item().
Therefore, just use %i in place of the %item() function. |
|
|
|
|
|
|
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
|
|