Dear community,
I would like to know, how I could detect the index of a special element in an array.
If this would be the array:
giTubMidNotnums[ ] fillarray 45, 52.28, 53.13, 56.6, 60.4, 67.68, 68.53, 72.0, 75.9, 83.18, 84.03, 87.5
how could I find the index for e.g. 60.4
Thanks for any hint!
Stefan
or you write a small udo which runs through the array and returns the index in case the element is being found:
opcode SearchEl, i, ii[]
;returns -1 if iEl is not in iArr, otherwise the index
iEl, iArr[] xin
iRes = -1
indx = 0
while indx < lenarray:i(iArr) do
if iEl == iArr[indx] then
iRes = indx
igoto end
endif
indx += 1
od
end:
xout iRes
endop