for to avoid executing when listitems = 0?
Posted: Sat Sep 02, 2017 12:16 pm
I just got a minor problem and I am trying to figure out best way to get around this problem.
In short idea is following:
works fine, unless there happens to be zero items in table.
I am now wondering best way to avoid this issue, so far i have thought of two possibilities:
or
These both work, but i would like some better idea, preferably something where i wouldnt need to add any extra code.
In short idea is following:
Code: Select all
for n = 0 to listitems(table)-1
do stuff with table[n] item
next
I am now wondering best way to avoid this issue, so far i have thought of two possibilities:
Code: Select all
if listitems(table) <> 0
for n = 0 to...
endif
Code: Select all
n = 0 to...
if n<>-1
do stuff
endif