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
fattony
Apprentice


Joined: 27 Dec 2001
Posts: 105
Location: USA

PostPosted: Sun Mar 17, 2002 11:20 pm   

String Lists
 
For some reason, a stringlist that I have will not allow duplicate values, and I can't figure out why. The list contains previous roulette numbers to aid in betting, but if a duplicate number occurs, it won't add it. Script is this:

Pattern: Hook O'Connel grunts 'The fuckin' winnin' number be (%w) (%d)'
Value: #if {%1 = black} {grl_color = B}
#if {%1 = red} {grl_color = R}
#if {%1 = green} {grl_color = G}
grl_number = %eval( @grl_color)%2
#if (%numitems( @grl_numberlist) = 10) {#delnitem grl_numberlist 1}
#additem grl_numberlist @grl_number

Is there some reason that wouldn't work? Thanks for any input you may have.

Fat Tony
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Sun Mar 17, 2002 11:34 pm   
 
If you wish to add duplicate values, you must use the %additem function, not the #ADDITEM command.

#VAR grl_numberlist %additem(@grl_number, @grl_numberlist)

will add duplicates.


Troubadour
Reply with quote
Morten
Apprentice


Joined: 17 Feb 2001
Posts: 119
Location: Denmark

PostPosted: Sun Mar 17, 2002 11:37 pm   
 
i think it is because you use #additem. i belive you should do it like this
#var grl_numberlist %additem(@grl_number,@grl_numberlist)

if you read the help file on #additem it saids:
Add an item to a string list. If the list does not exist yet, it is created. Duplicated values are not added using this command. To add a duplicate item to a list, use the %additem function.





Yugo Sangori
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