Difference between revisions of "Table"
From GiderosMobile
Line 12: | Line 12: | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
=== <translate>Methods</translate> === | === <translate>Methods</translate> === | ||
− | [[Special:MyLanguage/table.concat|table.concat]] ''<translate>returns concatenated table elements i to j separated by sep</translate>''<br/><!-- GIDEROSMTD:table.concat --> | + | [[Special:MyLanguage/table.concat|table.concat]] ''<translate>returns concatenated table elements i to j separated by sep</translate>''<br/><!-- GIDEROSMTD:table.concat(table,sep,i,j) returns concatenated table elements i to j separated by sep --> |
[[Special:MyLanguage/table.getn|table.getn]] ''<translate>returns size of table, or n field, or table.setn value, or 1 less first index with nil value | [[Special:MyLanguage/table.getn|table.getn]] ''<translate>returns size of table, or n field, or table.setn value, or 1 less first index with nil value | ||
− | [Deprecated in Lua 5.1, use # operator]</translate>''<br/><!-- GIDEROSMTD:table.getn --> | + | [Deprecated in Lua 5.1, use # operator]</translate>''<br/><!-- GIDEROSMTD:table.getn(table) returns size of table, or n field, or table.setn value, or 1 less first index with nil value |
− | [[Special:MyLanguage/table.insert|table.insert]] ''<translate>insert value at location pos in table, default pos=n 1</translate>''<br/><!-- GIDEROSMTD:table.insert --> | + | [Deprecated in Lua 5.1, use # operator] --> |
− | [[Special:MyLanguage/table.remove|table.remove]] ''<translate>removes element at pos from table, default pos=n</translate>''<br/><!-- GIDEROSMTD:table.remove --> | + | [[Special:MyLanguage/table.insert|table.insert]] ''<translate>insert value at location pos in table, default pos=n 1</translate>''<br/><!-- GIDEROSMTD:table.insert(table,pos,value) insert value at location pos in table, default pos=n 1 --> |
− | [[Special:MyLanguage/table.sort|table.sort]] ''<translate>sorts in-place elements 1 to n, comp(v1,v2- true if v1<v2, default <</translate>''<br/><!-- GIDEROSMTD:table.sort --> | + | [[Special:MyLanguage/table.remove|table.remove]] ''<translate>removes element at pos from table, default pos=n</translate>''<br/><!-- GIDEROSMTD:table.remove(table,pos) removes element at pos from table, default pos=n --> |
+ | [[Special:MyLanguage/table.sort|table.sort]] ''<translate>sorts in-place elements 1 to n, comp(v1,v2- true if v1<v2, default <</translate>''<br/><!-- GIDEROSMTD:table.sort(table,comp) sorts in-place elements 1 to n, comp(v1,v2- true if v1<v2, default < --> | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
=== <translate>Events</translate> === | === <translate>Events</translate> === | ||
=== <translate>Constants</translate> === | === <translate>Constants</translate> === | ||
|} | |} |
Revision as of 15:32, 13 September 2018
Supported platforms:
Available since: Gideros 2011.6
Description
This library provides generic functions for table manipulation. It provides all its functions inside the table table.
Most functions in the table library assume that the table represents an array or a list. For these functions, when we talk about the "length" of a table we mean the result of the length operator.
Methodstable.concat returns concatenated table elements i to j separated by sep [Deprecated in Lua 5.1, use # operator] table.insert insert value at location pos in table, default pos=n 1 |
EventsConstants |