logo
Home XtGem- Templates- XtScript- bottom
XtGemmanual

XtScript basics

goto

Loops and jumps in Xtscript use the goto @target command

Syntax

@target
[...
...]
goto @target [...] optional · ... your value

Notes

WARNING:
Endless or very large loops will cause xtscript timeouts!

Example

<!--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-->

Copy as text

Output reload

 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10
$num=11

Related

if if and if or
if not or if not or not if elseif

XtGem manual · all sections

Powered by XtGem
About us Contact Forum top