Difference between revisions of "Goto"

607 bytes added ,  01:07, 22 August 2015
no edit summary
imported>Cipscis
(Added note about available label IDs, and link to Label)
imported>JT
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Function
{{Function
  |origin = FOSE1
  |origin = FOSE1
  |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.
  |summary = Jump to ("go 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
  |Value = 0-255
   }}
   }}
|example = int GetNextActor
set GetNextActor to 1
Label GetNextActor
; Do something
if SomeCondition
    GoTo GetNextActor
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, 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]]
* [[Foreach]]
 
==External Links==
* [http://www.cipscis.com/fallout/tutorials/loops.aspx Loops]
* [http://fose.silverlock.org/fose_command_doc.html#Goto FOSE Documentation]
 
[[Category:Functions_(FOSE)]]
[[Category:Functions_(FOSE)]]
Anonymous user