Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > 94c03425397d909fa9cf2ef30199e290 > files > 50

gnuplot-nox-5.2.2-5.2.mga7.armv7hl.rpm

#
# Unit test for `break` and `continue` commands
# Two different entry actions:
# "load break_continue.dem" executes the main loop
# "call break_continue.dem foo" executes the inner clause
#
if (ARGC == 0) {

do for [i=1:6] {
    print "start ", i;
    call 'break_continue.dem' sub1
    if (i > 4) { print ">>> ERROR <<<" }
    print "end ", i
}
print "done with for loop"

} else {

print "   continue if i == 3, break if i > 4"
if (i > 4) { break; }
if (i == 3) { continue; print ">>> ERROR <<<" }
print "      still in load file"
exit	# exits only from this level of the call stack
print ">>> failed to exit <<<"
}