Has
True if the given value is a member of the given list. The membership-test primitive for list-typed variables.
Category: List
Returns: bool
Signature
Has(list, value)
The first argument is a list-typed variable. The second is the value to search for.
Examples
Has(var_inventory, "item_key") // true if the key is in inventory
!Has(var_visited_locations, "location_market")
// gate first-time arrival speech
Has(var_party, "char_kim") // true if Kim is in the active party
Notes
The value must be a quoted string literal, or a variable that holds one. A
bare, unquoted word that is not a declared variable, such as char_kim
without quotes, is not valid here and raises an error when the expression
runs.
Comparison is case-sensitive: "key" and "Key" are different values. This
differs from the == operator elsewhere in expressions, which compares
strings case-insensitively; see
Expressions.
Lists in StoryBonsai are immutable. Has is a pure read. To add or remove members see Add and Remove.