Documentation

makevar

makevar

Syntax: zs.makevar{prop-list}

Creates a new variable or modifies an existing variable and returns the Variable record. This uses the Lua class syntax of {prop-list} where {prop-list} is a table of property values. Some properties can be set by the index (position in the table), while other properties can be set by name.

The indexed properties are: Name, Value, and Class. So, for example:

a = zs.makevar{"myvar", "commands", "myclass"}

will create an variable called "myvar" in the class folder "myclass" with the "commands" as the value of the variable. This same variable could have been created with the syntax:

a = zs.makevar{name="myvar", value="commands", class="myclass"}

This key=value syntax allows you to set *any* of the properties of the Variable object at creation time directly.

Add comment

Login or register to post comments