Is there any command to stop the loop?

Hello everyone
I wan’t to play a loop that reads the records from a CSV and does some stuff with it. Is there any command I can use with if/else to stop the loop in a certain situation? Thanks.

What situation? In any case you can break a loop by

Meanwhile we have BREAK and CONTINUE:

If you are working with loops, you might find it useful at some point to either break the loop when a certain condition is met or you might want to skip over one or more iterations of the loop. This is what the break and continue statements are used for.

May I suggest that there be an effort to making the documentation more consistent and complete? This is just one example, but there’s no syntax provided for break or continue at all. I’m left to guess if I simply enter the command and leave Target and Value blank or if there is some functionality with those fields.

[edit]
Actually, I’m wondering if you can check that “continue” is working as intended? My script is too complex to bother asking you to troubleshoot, but it APPEARS that continue breaks out of the top-most loop rather than the loop the code is in. Something like this psuedo-code:

Foreach element of array
While $i < 10
if $i = 5
Continue
end
echo $i
$i++
end
end

In just about any scripting language, I’d expect to see 1 through 10 printed, except for 5 which would get skipped, and that would repeat for however many elements are in the array.

But in my testing, it appears to instead skip that element so 1 through 4 would be printed and 5 and up would never be.

But, again, maybe its just my complex script. Maybe it is fine and I’ve got something else going on.