Loops/Wrong ranges: Difference between revisions

m
Line 530:
=={{header|Phix}}==
Phix for loops do not allow a zero step (neither are any floating point values permitted).<br>
The following shows the behaviour of both for and while loops, and the latter has ana additonalcouple of
additional commented out termination checkchecks that might be appropriate in some cases.
<lang Phix>procedure test(integer start, stop, step, string legend, bool bFor)
sequence res = {}
Line 551:
if length(res)>9 then exit end if
-- if i=stop then exit end if
-- if step=0 then exit end if
i += step
end while
7,820

edits