Documentation

makefunc

makefunc

Syntax: zs.makefunc{prop-list}

Creates a new function or modifies an existing function and returns the Function 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/Script, and Class. So, for example:

a = zs.makefunc{"myfunc", "commands", "myclass"}

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

a = zs.makefunc{name="myfunc", value="commands", class="myclass"}

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

Add comment

Login or register to post comments