Scaleform Studio Lua API Reference: table namespace reference
Table namespace
|
concat ( t, sep, i, j ) : string
Concatenates the elements of the table to form a string, where a separator can be specified to be placed between the concatenated
elements (`table[i]..sep..table[i+1] ...
|
Parameters t : | table |
The table to concatenate, the elements may be string or numbers.
|
sep : | string? |
The separator string, default value is an empty string.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
i : | number? |
The beginning index to the table to be concatenated. Default value of 1.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
j : | number? |
The ending index to the table to be concatenated. Default value is the length of the table t. If i is greater than j, returns the empty string.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
Returns string |
The resultant string containing the elements of the table.
|
sep..table[j]`).
|
Returns the size of the table where size is largest numerical index with a non-nil value in the table.
|
Parameters Returns number |
The size of the table.
|
|
Inserts a value at the specified position in the table.
|
Parameters t : | table |
The table.
|
pos : | number |
The index of the table where a new element is inserted. The default value is length of the table + 1 so that table.insert(t,x) inserts x at the end of table t.
|
value : | any(string,integer) |
The value to be inserted in the table.
The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses. |
Returns | This function does not return any values. |
|
Returns the largest positive numerical index of the given table, or zero if the table has no positive numerical indices.
|
Parameters t : | table |
The table to traverse.
|
Returns number |
The largest positive numerical index.
|
|
Returns the element at the specified position from the table, shifting down other elements to close the space, if necessary.
|
Parameters t : | table |
The table.
|
pos : | number? |
The index of the table from where an element is removed. Default value is the length of the table, so table.remove(t) removes the last element of table t.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
Returns number |
The value of the removed element from the table.
|
|
Sorts table elements in a given order, in-place, from table[1] to table[n], where n is the length of the table.
|
Parameters t : | table |
The table to sort.
|
comp : | fun(number,number:boolean) |
If given, this must be a function that receives two arguments, and returns true if the first argument should come first in the sorted array.
The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon.. |
Returns | This function does not return any values. |
If comp is not given, then the standard
Lua operator < is used instead.
The sort algorithm is not stable; that is, elements considered equal by the given order may have their relative positions changed by the sort.
table.concat (t, sep, i, j) : string
Concatenates the elements of the table to form a string, where a separator can be specified to be placed between the concatenated
elements (`table[i]..sep..table[i+1] ...
t : table
The table to concatenate, the elements may be string or numbers.
sep : string?
The separator string, default value is an empty string.The ? notation indicates that this type is optional: there may be zero or one instances of it.
i : number?
The beginning index to the table to be concatenated. [more...]The ? notation indicates that this type is optional: there may be zero or one instances of it.
j : number?
The ending index to the table to be concatenated. [more...]The ? notation indicates that this type is optional: there may be zero or one instances of it.
string
The resultant string containing the elements of the table.A Lua table consisting of paired keys and values.A string of characters.A numeric value.
table.getn (t) : number
Returns the size of the table where size is largest numerical index with a non-nil value in the table.
t : table
The table.
number
The size of the table.
table.insert (t, pos, value)
Inserts a value at the specified position in the table.
t : table
The table.
pos : number
The index of the table where a new element is inserted. [more...]
value : any(string,integer)
The value to be inserted in the table.The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses.
A strictly integral numeric value, with no decimal component.
table.maxn (t) : number
Returns the largest positive numerical index of the given table, or zero if the table has no positive numerical indices.
t : table
The table to traverse.
number
The largest positive numerical index.
table.remove (t, pos) : number
Returns the element at the specified position from the table, shifting down other elements to close the space, if necessary.
t : table
The table.
pos : number?
The index of the table from where an element is removed. [more...]The ? notation indicates that this type is optional: there may be zero or one instances of it.
number
The value of the removed element from the table.
table.sort (t, comp)
Sorts table elements in a given order, in-place, from table[1] to table[n], where n is the length of the table.
t : table
The table to sort.
comp : fun(number,number:boolean)
If given, this must be a function that receives two arguments, and returns true if the first argument should come first in the sorted array.The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..
true or false.Indicates a table.
This documentation uses the term table to mean an anonymous, temporary Lua table that contains named data values. You typically use these tables to pass data or settings to a function, or to hold data returned by a function.Indicates an object.
This documentation uses the term object to mean a named Lua table or userdata value that maintains a state. Some object types may have multiple instances existing at the same time, each with its own state; these objects typically have creation functions or accessors that you must call in order to get an instance. Some object types have only one instance, which you always access through the object's name.Indicates a named variable within a namespace, object or table; or an element within an enumeration.Indicates a code sample.Indicates an enumeration.
This documentation uses the term enumeration to mean a named Lua table that contains only a set of constant values. These values typically identify a predefined set of options for some setting or behavior. You might pass an enumeration value to a function, or test the value returned by a function against the items in the enumeration to see which option is currently set.Indicates a named variable within a namespace or object that has a pre-set constant value.Indicates a category: a semantic grouping of related API elements.Indicates a namespace.
This documentation uses the term namespace to mean a named Lua table that exists in only one single instance, intended as a container for an interface of related objects, functions and data variables.Indicates an output value returned by a function.Indicates a named function within a namespace or object.Indicates an input parameter for a function.