logo
Home XtGem- Templates- XtScript- bottom
Loops and jumps in Xtscript use the goto @target command
[...] = optional ... = your value
@target
[...
...]
goto @target
WARNING:
Endless or very large loops will cause xtscript timeouts!
Show in textarea
<!--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
Powered by XtGem
About us Contact Forum topÂ