INDEXS function
Syntax
INDEXS (dynamic.array, substring, occurrence)
CALL -INDEXS (return.array, dynamic.array, substring, occurrence)
CALL !INDEXS (return.array, dynamic.array, substring, occurrence)
Description
Use the INDEXS function to return a dynamic array of the starting column positions for a specified occurrence of a substring in each element of dynamic.array.
Each element is examined for substring.
occurrence specifies which occurrence of substring is to be located.
When substring is found, and if it meets the occurrence criterion, the starting column position of the substring is returned. If substring is an empty string, 1 is returned. If the specified occurrence of substring cannot be found, 0 is returned.
If dynamic.array evaluates to the null value, 0 is returned. If any element of dynamic.array is null, 0 is returned for that element. If occurrence is the null value, the INDEXS function fails and the program terminates with a run-time error message.
If you use the subroutine syntax, the resulting dynamic array is returned as return.array.