Difference between revisions of "Goto"

From Free Pascal wiki
Jump to navigationJump to search
m (moved goto to Goto)
(No difference)

Revision as of 21:31, 16 October 2015

Deutsch (de) English (en) français (fr) русский (ru)

Goto is an unconditional jump to a previously declared label (either before or after the goto command).
Example for the declaration of a label and use of goto:

var
  fWaterIsBoiling: Boolean;
 
label
  SwitchOffKettle;
 
begin
  ...
  if fWaterIsBoiling = True then Goto SwitchOffKettle;
  ...
SwitchOffKettle:
  ...
end;