PicoMite array questions


Author Message
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6543
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