GoFiler Legato Script Reference
Legato v 1.5d Application v 5.25a
|
Table of Contents | < < Previous | Next >> |
Chapter Three — Data Types and Operators (continued)
Overview
The ArrayGetAxisSize function returns the allocated size of a complete array or a specific axis.
Syntax/Parameters
Syntax
int = ArrayGetAxisSize ( variable name, [int axis] );
Parameters
name
A name of a variable, which must be an array.
axis
An optional int specifying the axis to measure. The following are possible values:
Define | Value | Description |
AXIS_X/AXIS_ROW | 0 | X dimension (rows) |
AXIS_Y/AXIS_COL | 1 | Y dimension (columns) |
AXIS_Z | 2 | Z dimension |
AXIS_ALL | -1 | All axes |
The default value is AXIS_X/AXIS_ROW. Use -1 to retrieve the number of elements allocated for all dimensions of the array.
Return Value
Returns an int specifying the number of elements allocated or -1 on failure. Use the GetLastError function to retrieve a formatted error code.
Remarks
The ArrayGetAxisSize function returns the size of the array or array dimension in array units (not bytes). This number reflects the elements allocated. An element is considered “used” once it has been either referenced or assigned a value. If the element is referenced as an index, all items with a lower value will also be considered used. For example:
string list[200]; int x1, x2, x3, size; size = ArrayGetAxisSize(list); x1 = ArrayGetAxisDepth(list); list["first"] = "My String"; x2 = ArrayGetAxisDepth(list); list[16] = "Farther in list"; x3 = ArrayGetAxisDepth(list); MessageBox('I', "Size: %d\rBefore: %d\rOne key: %d\rSet at '16': %d", size, x1, x2, x3);
The result will be:
When retrieving the size for all axes, each dimension is multiplied for a total number of allocated elements.
Related Functions
Platform Support
Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL
Legato IDE, Legato Basic
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.