Variant

From Riftui Wiki

Jump to: navigation, search

With lua, a variant is not a data type in itself, but rather is used to denote a variable that will be used to hold more than one data type.

For instance, in the following example, someone could pass an item table in the "item" parameter or simply pass it a string containing the name of the item. As such, the documentation states that it takes a variant because it can hold either.

Example:

documentation = Inspect.Documentation(item)   -- string <- variant
 
--item:	The item to get documentation on. May be either the item itself or a string identifier.
Personal tools
Namespaces
Variants
Actions
Menu
Wiki
Toolbox