Jump: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Hendricks266 (talk | contribs) No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
jump < | '''jump''' <address> | ||
< | <address> is a gamevar that stores the destination address. | ||
Transfers control to another statement with a specified <address> which should be obtained by the [[getcurraddress]] command. The address must be obtained before the corresponding jump command. This limitation prevents jumping forward. | |||
Here is | Here is an example that shows how to make a countdown loop (from 10 to 1) using the jump command. | ||
// addr and i are gamevars. | // addr and i are gamevars. | ||
setvar i 10 | setvar i 10 | ||
Line 12: | Line 12: | ||
addlogvar i | addlogvar i | ||
subvar i 1 | subvar i 1 | ||
ifvarn i 0 jump addr // if i isn't 0, | ifvarn i 0 jump addr // if 'i' isn't 0, jumps to addr | ||
[[Category:EDuke32 specific commands]] | [[Category:EDuke32 specific commands]] |
Latest revision as of 18:51, 7 January 2011
jump <address>
<address> is a gamevar that stores the destination address.
Transfers control to another statement with a specified <address> which should be obtained by the getcurraddress command. The address must be obtained before the corresponding jump command. This limitation prevents jumping forward.
Here is an example that shows how to make a countdown loop (from 10 to 1) using the jump command.
// 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, jumps to addr