© Tyl Software Foundation 2019-2021
▶ CONTINUE STATEMENT
Continue causes the system to stop execution of a
compound statement and
continue in the next iteration of the enclosing looping statement.
Here is a continue example from the examples:
Here is a continue example from the examples:
print 'module start'
nums 1 2 3
nums num ~
print 'loop iter: ' + num
num 2 ?
print 'CONTINUE'
%~
! next statements in the enclosing looping block will not be executed...
print 'statement after breaking...'
^
print 'loop iter end'
^
print 'module end'
module start
loop iter: 1
loop iter end
loop iter: 2
CONTINUE
loop iter: 3
loop iter end
module end
loop iter: 1
loop iter end
loop iter: 2
CONTINUE
loop iter: 3
loop iter end
module end
The two characters code '
Similar to other break statements, continue statment can run a statement before continuing:
%~
', is Tyl code for continue statement, and
Tyl Symbolizer will replace it with '⇧
'.
Similar to other break statements, continue statment can run a statement before continuing:
go:
primes 10
primes max:
max ++
i max ~
i 0 ? %~
dmax 1 + math.floor math.sqrt i
idiv div 0
d dmax ~
d <= 1 ? %~
idiv integraldivision i d ? % div d
^
idiv > 0 ? %~ print i + ' = ' + div + ' * ' + idiv
print i + ' is prime'
^
integraldivision number divisor:
division number / divisor
result math.floor division
result division ? result \ 0
1 is prime
2 is prime
3 is prime
4 = 2 * 2
5 is prime
6 = 2 * 3
7 is prime
8 = 2 * 4
9 = 3 * 3
10 = 2 * 5
2 is prime
3 is prime
4 = 2 * 2
5 is prime
6 = 2 * 3
7 is prime
8 = 2 * 4
9 = 3 * 3
10 = 2 * 5