List
The List function lists the contents of a value. The value may be a number, string, or a table. For a table, this function lists only the indexed array elements of the table. Nestest, or multi-dimensional tables are supported. Since only the array components are listed, the table keys are not listed. This function is indended for use with tables used as an array.
List( value )
If value is simple, as with a string or number, then List works like the Printf function by just listing the value. If value is a table, then only the indexed table elements are listed. In contrast, the TList function lists the entire table contents..
The following script creates a complex table and lists its contents.
|
-- create a table |
|
-- list the table |
This script prints the output below. Notice that only the array components are listed. The "hash" components, with key names A, x, and y, are not listed.
The script below lists a nexted table that consists entirely of arrays.
|
-- create a table (an array) |
|
-- list the result |
This script lists the entire table content. There are no named keys so the table is a pure array.