Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Pascal - <b> label target for goto pp 48</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 LABEL                         Target for Goto                         pp 48


 Define:  A label is a reference for a Goto statement.

 Purpose: Provides a target address to jump to.

 Notes:   Any statement in a program may be prefixed with a label,
          enabling that statement to be directly branched to via Goto.

          Before use, the label must be declared in a label declaration
          part.  The reserved word label is followed by one or more
          targets separated by commas and terminated by a semi-colon.
          The scope of the label is the block in which it is declared.

          Labels may be made of both letters, digits, and underscores,
          with the first character of the label being a letter.
          The label name itself is terminated with a colon.

 Usage:
       LABEL
          Target1,                      { All labels separated by commas    }
          Target2,
          Target3;                      { Last label ends with semicolon    }

       BEGIN
          WriteLn ('Start here..')   ;
          Goto Target1               ;  { Branch to label 'Target1'         }
          WriteLn ('Skip this..')    ;  { Skip this statement               }
          Target1:                      { Destination of Goto statement     }
          WriteLn ('Target of Goto') ;
       END.

See Also: Goto

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson