GOTO INDEX

GOTO _ _ _ _ _ _ _ _ _ _ _ _ command

Inside a begin...end block, goto, or preferably, go to, transfers flow of control to a labeled statement.

syntax:

go to<labeled_statement> or goto <labeled_statement >

<labeled_statement> is of the form <label> :<statement >

examples:


     procedure dumb(a);
        begin scalar q;
           go to lab;
           q := df(a**2 - sin(a),a);
           write q;
      lab: return a
        end;
 

  DUMB 



dumb(17); 

  17

go tocan only be used inside a begin...end block, and inside the block only statements at the top level can be labeled, not ones inside <<...>>, while...do, etc.