ui.Dialog.arrayToVisualIndex
Converts the program array index to the visual index for a given screen array.
Syntax
arrayToVisualIndex(
name STRING,
arrayIndex INTEGER
) RETURNS INTEGER
- name is the name of the screen record, see Identifying screen-arrays in ui.Dialog methods.
- arrayIndex is the index of the program array row.
Usage
When the end user sorts rows in a table, the program array index may differ from the visual row index.
Use this method to convert a program array row index (arr_curr()
) to
a row index as seen by the end user. For example, if you want to display a typical
message with (current-row / total-rows),
convert the current program array row to a visual row index before displaying the
value:
MESSAGE SFMT( "Row: %1/%2",
DIALOG.arrayToVisualIndex( "sr", DIALOG.getCurrentRow("sr") ),
DIALOG.getArrayLength( "sr" )
)