 |
fattony Apprentice
Joined: 27 Dec 2001 Posts: 105 Location: USA
|
Posted: 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 |
|
|
|
 |
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: 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  |
|
|
|
 |
Morten Apprentice
Joined: 17 Feb 2001 Posts: 119 Location: Denmark
|
Posted: 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 |
|
|
|
 |
|
|
|