Loops and jumps in Xtscript use the goto @target command
[...] = optional ... = your value
@...
[...
...]
goto @...
WARNING:
Endless or very large loops will cause xtscript timeouts!
<!--parser:xtscript-->
# Simple loop
var $num = 1
@loop_start
if $num <= 10
print &nbsp;|&nbsp;$num
  var $num = ($num+1)
  goto @loop_start
endif
print <hr />


# Simple jump
if $num == 11
  goto @next
endif
print This bit is skipped
return nothing
@next
print \$num=11<hr />
<!--/parser:xtscript-->
Show in textarea
Reload
 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10
$num=11