|
![](templates/Classic/images/spacer.gif) |
|
ADDITEM
Syntax: #ADDI listname item
Related: #DELITEM, #DELNITEM, %additem, %delitem
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.
ADDITEM Example
#ADDITEM Friends Zugg
Adds "Zugg" to the stringlist Friends |
User comments |
mgoho: Thu Nov 11, 2004 6:22 pm |
|
Does additem automatically check to see if the item being added is in the list? I'm trying to add a variable to a string list and it only adds it if it's not already in the string. |
|
![](templates/subSilver/images/spacer.gif) |
Zugg: Thu Nov 11, 2004 7:14 pm |
|
Quote: |
Duplicated values are not added using this command. |
So yes, when using the #ADDITEM command, it checks first and only adds the item if it's not already in the list. If you use the %additem function instead, it allows duplicate values and does not check first. So if you want it to always add the new item, use the %additem function, like this:
#VAR List %additem(@NewItem, @List) |
|
![](templates/subSilver/images/spacer.gif) |
|