![](templates/Classic/images/spacer.gif) |
GeneralStonewall Magician
Joined: 02 Feb 2004 Posts: 364 Location: USA
|
Posted: Wed Jun 16, 2010 7:19 am
[3.19e] BUG: #ADDITEM var "item" allowing duplicates |
Putting quotations around the item with #additem is allowing duplicates.
code:
Code: |
testvar = %null
#print {Using #additem var ~"item~" syntax:}
#10 {
#additem testvar "blah"
}
#print {Testvar: @testvar}
testvar = %null
#print {Using #additem var item syntax:}
#10 {
#additem testvar blah
}
#print {Testvar: @testvar} |
output:
Quote: |
Using #additem var "item" syntax:
Testvar: blah|blah|blah|blah|blah|blah|blah|blah|blah|blah
Using #additem var item syntax:
Testvar: blah |
|
|
|
![](templates/Classic/images/spacer.gif) |
charneus Wizard
![](images/avatars/51564989746d852114da6d.jpg)
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Wed Jun 16, 2010 8:11 am |
Confirmed on this end as well. Odd. I wonder if it's because CMUD sees the quotes in the command but doesn't see the quotes in the variable, therefore thinks it's a new item each time...
Charneus |
|
|
![](templates/Classic/images/spacer.gif) |
Zugg MASTER
![](images/avatars/164475849040f41c23b22fe.gif)
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Jun 16, 2010 4:38 pm |
Yep, confirmed. What is happening here is that #ADDITEM first does a search of the list to see if the item already exists. But it is searching for "item" (with the quotes) instead of just searching for item without the quotes. Since it doesn't find "item" in the list, it gets added, and the process of adding a literal string to a list strips the quotes.
|
|
|
![](templates/Classic/images/spacer.gif) |
|
|