Product SiteDocumentation Site

5.3.6.7. allIndexes


>>-allIndexes--------------------------------------------------><

Returns an array of all index positions in the array containing items. For multi-dimension arrays, each returned index will be an array of index values.

Example 5.132. Array class - allIndexes method

a = .array~of("Fred", "Mike", "David")

do name over a~allIndexes
   say name  -- displays "1", "2", and "3"
end

a~remove(2)  -- remove second item

do name over a~allIndexes
   say name  -- displays "1" and "3"
end