| Posted: 10:23am 09 Aug 2023 |
|
|
|
Not the fastest:
' DIM a(4) = (12,0,14.5,3,62)
DO m = MATH(MIN a(), index%) IF m = 0 THEN a(index%) = 100000 ENDIF LOOP UNTIL m > 0 PRINT index%, m
Make a copy of the array first if you need to retain all elements.
Another way is 'sort' then step through to skip over the zero values.
Jim |