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


Joined: 10 Dec 2002
Posts: 8

PostPosted: Tue Nov 18, 2003 2:53 am   

%additem, multiple items
 
Here's my variable command, but for some reason it's creating it on the same line of the list, instead of seperate lines... I'll explain after the statement.

Code:
#VARIABLE v%2 %additem( %item( @{v%2}, %ismember( 0, @{v%2})-1)<b>|1</b>, @{v%2})


Where the section is bolded, I was under the impression that it would create a string list with 1 as the second item, and all that junk before it as the first item. So if %2 was hello, then:

Variable vhello =
[1] <some number>
[2] 1
[ ]

Does that make sense?
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Tue Nov 18, 2003 10:01 am   
 
I am sorry it does not make sence because you did not give all the information on this script.

What is the trigger line?
are you just tring to take %1 and make it the secon item and %2 the 1 item?
ifso
#VAR "v%1" %additem(%2,@v%1,1)
#VAR "v%1" %additem(%1,@v%1,2)
Reply with quote
DevJez
Newbie


Joined: 10 Dec 2002
Posts: 8

PostPosted: Tue Nov 18, 2003 10:45 am   
 
That's basically it, yes... I was just confused, because on earlier versions of ZMud, you could seperate list elements with a "|" and it would make those two seperate items on the list. Now if you do that, it makes it one item with parens around it (in text mode), and a single item in the list mode.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Tue Nov 18, 2003 11:28 pm   
 
#FORALL {{item1|item2|ect}} {#VAR "v%1" %additem(%i,@v%1)}
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Nov 18, 2003 11:35 pm   
 
Zugg added the ability to nest stringlists a while ago, so now it's literally impossible as far as I know to add multiple items at one time to the main list as main-level items. You'll just have to add items one at a time the way Megamog and Shalimar illustrated.
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