Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter EightData Functions (continued)

8.4 Array Data Tools

8.4.1 Overview

As discussed in Chapter 3 under Dimensional Data, arrays can have up to 3 dimensions (4 if you count string character positions). In a low-level data sense, arrays can be simply thought of a 1, 2 or 3 dimensions, however, on a higher level sense, they can also be thought of as lists, tables and cubes.

A mini database can be established within Legato through the use of lists or tables. Within this scope, a single-dimension array is a list and a two-dimension array is a table. For tables, the convention is that the subscripts specify row and column (not x and y).

A number of terms are defined in the SDK for axis specification: AXIS_X (0) AXIS_Y (1) and AXIS_Z (2) for accessing data as in multiple-dimension format while AXIS_ROW (0) and AXIS_COL (1) for using table conventions. They essentially mean the same, it is just easier to think of a table in terms of rows and columns.

Most of the array tools included in this section work exclusively with strings.

This section covers some of the tools to manage the content of lists and tables.

8.4.2 Functions

Array Control:

ArrayAddKeyNames — Adds one or more key names to a specified axis.

ArrayGetAxisDepth — Gets the number of elements used by the highest index referenced.

ArrayClear — Clears an array, including key names for a specific axis, item or key.

ArrayFindKeyName — Finds a key name for a specified array and a specific axis.

ArrayHasKeyName — Checks an index position for the presence of a key name.

ArrayGetKeyName — Gets the name of a key at a specified index.

ArrayGetKeys — Gets an array of the key names for a specified axis.

Content (note that certain ‘Has’ versus ‘Is’ functions are symmetrical and can be used for coding clarity):

HasData — Tests a list or table for data.

HasColumnData — Tests a table column for data.

HasRowData — Tests a table row for data.

HasTableData — Tests a table for data.

IsEmpty — Tests a list or table as being empty.

IsListEmpty — Tests a list for data.

IsColumnEmpty — Tests a table column for data.

IsRowEmpty — Tests a table row for data.

IsTableEmpty — Tests a table for data.

Data In and Out of Arrays:

ArrayToParameters — Converts an array with key names into a parameter list with optional delimiter.

ExplodeString — Explodes a string line-by-line or by a specified delimiter into array entries.

ImplodeArray — Implodes string array entries (list) into a composite string with optional glue string.

ParametersToArray — Converts a parameter list into a string array with key names for the property names with optional delimiter string.

ParametersToTable — Converts a parameter list into a table with optional delimiter string.

TableToParameters — Translates table into a parameter style string.

Management:

DeleteEmptyTableRows — Removes empty rows from a table.

DeleteListItem — Removes item or items from a list.

DeleteTableRow — Removes row or rows from a table.

InsertListItem — Inserts empty item or items to a list.

InsertTableRow — Inserts empty row or rows to a table.

TableDeleteDuplicates — Removes duplicate table rows.

Math Style Functions:

ListDifference — Returns a set of all elements in list 'a' but not in list 'b'.

ListIntersection — Combines list 'a' and 'b' returning only common elements.

ListIsSubset — Returns true if every member of list 'a' is a member of list 'b'.

ListUnion — Combines list 'a and 'b' removing duplicates.

Search Functions:

BinarySearchList — Performs a binary search of a list.

BinarySearchTable — Performs a binary search of a table.

FindInList — Performs a linear search for an item in a list (single-dimension array) with options and starting string index.

FindInTable — Performs a linear search for an item in a table (two-dimensional array) with column, options, string index.

Sort Functions:

SortList — Sorts a list (single-dimensional array) with options.

SortTable — Sorts a table (two-dimensional array) with options and specified columns.

Page revised 2024-04-22