Editing Goto
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
|origin = FOSE1 | |origin = FOSE1 | ||
|summary = Jump to | |summary = Jump to a labeled position in the script previously defined by a call to Label. Execution will return to the label, simulating a loop. Be careful to provide an exit condition to avoid creating infinite loops. | ||
|name = Goto | |name = Goto | ||
|returnType = void | |returnType = void | ||
Line 8: | Line 8: | ||
|Name = labelID | |Name = labelID | ||
|Type = int | |Type = int | ||
}} | }} | ||
|example = int GetNextActor | |example = int GetNextActor | ||
Line 18: | Line 17: | ||
endif | endif | ||
}} | }} | ||
==Notes== | ==Notes== | ||
* There are 256 available slots for Labels, enabling IDs from 0 to 255 inclusively. Values outside of this range will not work. | *There are 256 available slots for Labels, enabling IDs from 0 to 255 inclusively. Values outside of this range will not work. | ||
* If using NVSE since version 4, | *If using NVSE since version 4, label/goto should be replaced by [[While]] or [[Foreach]] in all but exceptional cases, as these are more powerful, readable and reliable. Use of Label/goto for creating loops should be considered outdated and bad form. | ||
==See Also== | ==See Also== | ||
* [[Label]] | *[[Label]] | ||
* [[While]] | *[[While]] | ||
* [[Foreach]] | *[[Foreach]] | ||
[[Category:Functions_(FOSE)]] | [[Category:Functions_(FOSE)]] |