File r37/lisp/csl/html/r37_0050.html artifact 5b38d0246e part of check-in 1b32ca91d4



<A NAME=GOTO>

<TITLE>GOTO</TITLE></A>
<b><a href=r37_idx.html>INDEX</a></b><p><p>



<B>GOTO</B> _ _ _  _ _ _  _ _ _  _ _ _ <B>command</B><P>
<P>
 
Inside a <em>begin</em>...<em>end</em> 
<A HREF=r37_0041.html>block</A>, <em>goto</em>, or 
preferably, <em>go to</em>, transfers flow of control to a labeled statement. 
 <P> <H3> 
syntax: </H3>
<P>
<P>
<em>go to</em>&lt;labeled_statement&gt; or <em>goto</em> &lt;labeled_statement
&gt; 
<P>
<P>
<P>
&lt;labeled_statement&gt; is of the form &lt;label&gt; <em>:</em>&lt;statement
&gt; 
<P>
<P>
 <P> <H3> 
examples: </H3>
<P><PRE><TT>
     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

</TT></PRE><P><em>go to</em>can only be used inside a <em>begin</em>...<em>end
</em> 

<A HREF=r37_0041.html>block</A>, and inside 
the block only statements at the top level can be labeled, not ones inside 
<em>&lt;&lt;</em>...<em>&gt;&gt;</em>, 
<A HREF=r37_0228.html>while</A>...<em>do</em>, etc. 
<P>
<P>
<P>


REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]