bool = HaveItem(t, key) bool = HasItem(t, key)
key
or not. If there is an item at this index, HaveItem() will return True. This
is a convenience function for RawGet().
Note that if you pass a string in the key parameter, it will be converted
to lower case automatically. If you don't want that, use RawGet()
instead.
Starting with Hollywood 9.1, this function has a synonym called HasItem() which
does the same but is more grammatical.
True or False depending on whether the item exists
t = {x = 10, y = 20}
NPrint(HaveItem(t, "x"), HaveItem(t, "y"), HaveItem(t, "z"))
The code above will print 1 / 1 / 0 (= True, True, False).