Difference between revisions of "Switch jmp"
From Unofficial QEdit Wiki Guide
Japanaman2 (Talk | contribs) |
LunarFuror (Talk | contribs) (→Syntax) |
||
Line 3: | Line 3: | ||
* register1 = Register to check value | * register1 = Register to check value | ||
− | * string = | + | * string = Message to display |
+ | * See list of [[Special characters]] | ||
==Use== | ==Use== |
Revision as of 14:05, 9 April 2021
Contents
Syntax
Syntax: switch_jmp register1, string
- register1 = Register to check value
- string = Message to display
- See list of Special characters
Use
Used to jump to different functions depending on a registers value.
Example
0: get_slotnumber R250
ret
1: ret
100: switch_jmp R250, 4:101:102:103:104 //Registers value to check, number of switches, function to jmp to based on the registers value.
101: window_msg 'You are in the red slot.'
winend
ret
102: window_msg 'You are in the green slot.'
winend
ret
103: window_msg 'You are in the yellow slot.'
winend
ret
104: window_msg 'You are in the blue slot.'
winend
ret