Jump

From EDukeWiki
Revision as of 01:43, 21 April 2008 by Jblade (talk | contribs)
Jump to navigation Jump to search

jump <addr>

<addr> - is a gamevar obtained by getcurraddress

This command is also know as GOTO(http://en.wikipedia.org/wiki/Goto). Too bad this jump command isn't as good as it can be. It hardly can be used to jump forward because <addr> isn't known.

Here is en example. It countdowns the i variable from 10 to 0.

 // addr and i are gamevars.
 setvar i 10
 getcurraddress addr
 // begin loop
 addlogvar i
 subvar i 1
 ifvarn i 0 jump addr // if i isn't 0, jump to addr

Yes, it could be done via whilevarn but it's just an example.