Notifications
Clear all

[Closed] Finditem and multidimensional arrays

Is there a finditem equivalent for multidemensional arrays, or do I have to loop through my my sub arrays and perform a finditem on each?

thanks

4 Replies

Do you know how to write a recursive function? If so, there’s your answer. If not, ask back here.

I’m all ears… It’s probably what I’m already doing, but hopefully it’ll be structured better

 eek

test=#(1,2,3,#(1,2,3,#(1,2,3)))

test[1] = 1
test[2] = 2
test[3] = 3
test[4] = #(1,2,3,#(1,2,3))
test[4][1] = 1 (of that array)

but to generate that index I’d have to search through the arrays doing a finditem for each?

Eg: I want to find out if “9” features in stuff, and get an index. At the moment I’m doing a finditem for each of the sub arrays and then returning the result of the finditem along with the array it was in… ie: stuff[5][4]

stuff=#(1,2,3,4#,(6,7,8,9))