SYS_LAST_ARRAY_INDEX
Use the SYS_LAST_ARRAY_INDEX script function to return the last filled index of an array. Populate the array with the :FILL script statement before you use this function.
Syntax
SYS_LAST_ARRAY_INDEX()
Parameter
- SYS_LAST_ARRAY_INDEX
Retrieves the last filled index of a script variable array
Return Code
The script function returns the last index that was filled in the array.
Example
The following example fills a script variable array with values from a VARA object. The SYS_LAST_ARRAY_INDEX function returns the last index to be filled in the array. The script prints the returned index in the activation report.
:DEFINE &ARRAY#, string, 20
:FILL &ARRAY#[] = GET_VAR(VARA.TEST, 'A')
:SET &INDEXES# = SYS_LAST_ARRAY_INDEX()
:PRINT &INDEXES#
See also:
Script Element | Description |
---|---|
Stores several values to a script array. |
|
LENGTH | Retrieves the size of a script array. |
Script Elements - Script Structure and Processing
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by Function