Statement | AddBag |
---|---|
Version | 2.2.1+ |
Purpose | Adds a value into a 'bag' containing a collection of values, creating the bag if necessary |
The AddBag statement requires a type, bag name and value, in the format
AddBag <type> <bag name> <value>
The following example demonstrates the 'unique' method of adding a value to a bag
${myvalue} = "a"
AddBag unique bag1 ${myvalue}
AddBag unique bag1 "b"
AddBag unique bag1 "a"
# 'bag1' bag contains the values "a" and "b"
The following example demonstrates the 'multi' method of adding a value to a bag
${myvalue} = "a"
AddBag multi bag2 ${myvalue}
AddBag multi bag2 "b"
AddBag multi bag2 "a"
# 'bag2' bag contains the values "a", "b" and "a"