Skip to content
shadow7483147 edited this page Jul 21, 2020 · 15 revisions

Syntax

Tables and Arrays are used to store variables into an ordered, accessible type of variable. They make up a special case of variable access and assignment.

Arrays are functionally similar to tables, in particular being slightly more efficient, but they cannot store arrays or tables themselves, and do not have string key indices.

Examples

See Expression 2 Examples: Table.

Syntax Description
TableVar["test",bone] This will return the value at the table's "test" string key, with the explicit type "bone"
TableVar[4,bone] This will return the value at the table's 4th numeric index, with the explicit type "bone"
TableVar[8,vector] = Vec This assigns the variable Vec to TableVar's 8th index.
VarArray["beef",vector] = Vec This assignment is invalid, as arrays do not have string keys.

Shared functions

Below is a function list from the Table core and Array core extensions. Any functions that are supported only by either an array or a table are listed further down below.

Function Return Example Print
T:concat([S,N,N])
A:concat()
T=table(2,3), T["a",number]=4, print(T:concat()) 23
Concatenates the elements of the table/array's numeric indices to a string. Optionally, a string delimiter may be used, which separates the concatenated elements in the returned string. You may also define the index to start at, and an index to end at, inclusively.
T:concat()
A:concat()
T=table(2,3), T["a",number]=4, print(T:concat()) 23
Concatenates the elements of the table/array's numeric indices to a string.

Expression 2 ⚙️

Getting Started 🕊

Guides (In learning order) 🎓

Tools 🛠️

Click To Expand

Advanced

Beacon 💡

Control 🎛️

Data 💿

Detection 👀

Display 💻

Render 🖌

I/O 🔌

Physics 🚀

Utilities 🛠️

RFID 💳

Wireless 🛜

Gates 🚥

Click To Expand

TBD

Extras 🔭

Clone this wiki locally