Sophie

Sophie

distrib > Mandriva > 8.1 > i586 > by-pkgid > 700475c8ae73fb4d57b6df4485c29e1c > files > 187

slang-doc-1.4.4-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
 <TITLE> A Guide to the S-Lang Language: Statements</TITLE>
 <LINK HREF="slang-9.html" REL=next>
 <LINK HREF="slang-7.html" REL=previous>
 <LINK HREF="slang.html#toc8" REL=contents>
</HEAD>
<BODY>
<A HREF="slang-9.html">Next</A>
<A HREF="slang-7.html">Previous</A>
<A HREF="slang.html#toc8">Contents</A>
<HR>
<H2><A NAME="s8">8. Statements</A></H2>

<P> 
<P>Loosely speaking, a <EM>statement</EM> is composed of <EM>expressions</EM>
that are grouped according to the syntax or grammar of the language
to express a complete computation.  Statements are analogous to
sentences in a human language and expressions are like phrases.
All statements in the <B>S-Lang</B> language must end in a semi-colon.
<P>A statement that occurs within a function is executed only during
execution of the function.  However, statements that occur outside
the context of a function are evaluated immediately.
<P>The language supports several different types of statements such as
assignment statements, conditional statements, and so forth.  These
are described in detail in the following sections.
<P>
<H2><A NAME="ss8.1">8.1 Variable Declaration Statements</A>
</H2>

<P>Variable declarations were already discussed in chapter ???.  For
the sake of completeness, a variable declaration is a statement of
the form
<BLOCKQUOTE><CODE>
variable <EM>variable-declaration-list</EM> ;
</CODE></BLOCKQUOTE>

where the <EM>variable-declaration-list</EM> is a comma separated list
of one or more variable names with optional initializations, e.g.,
<BLOCKQUOTE><CODE>
<PRE>
     variable x, y = 2, z;
</PRE>
</CODE></BLOCKQUOTE>
<H2><A NAME="ss8.2">8.2 Assignment Statements</A>
</H2>

<P> 
<P>Perhaps the most well known form of statement is the <EM>assignment
statement</EM>.  Statements of this type consist of a left-hand side,
an assignment operator, and a right-hand side.  The left-hand side
must be something to which an assignment can be performed.  Such
an object is called an <EM>lvalue</EM>.
<P>The most common assignment operator is the simple assignment
operator <CODE>=</CODE>.  Simple of its use include
<BLOCKQUOTE><CODE>
<PRE>
      x = 3;
      x = some_function (10);
      x = 34 + 27/y + some_function (z);
      x = x + 3;
</PRE>
</CODE></BLOCKQUOTE>

In addition to the simple assignment operator, <B>S-Lang</B>
also supports the assignment operators <CODE>+=</CODE> and <CODE>-=</CODE>.
Internally, <B>S-Lang</B> transforms
<BLOCKQUOTE><CODE>
<PRE>
       a += b;
</PRE>
</CODE></BLOCKQUOTE>

to
<BLOCKQUOTE><CODE>
<PRE>
       a = a + b;
</PRE>
</CODE></BLOCKQUOTE>

Similarly, <CODE>a -= b</CODE> is transformed to <CODE>a = a - b</CODE>.  It is
extremely important to realize that, in general, <CODE>a+b</CODE> is not
equal to <CODE>b+a</CODE>.  This means that <CODE>a+=b</CODE> is not the same
as <CODE>a=b+a</CODE>.  As an example consider
<BLOCKQUOTE><CODE>
<PRE>
      a = "hello"; a += "world";
</PRE>
</CODE></BLOCKQUOTE>

After execution of these two statements, <CODE>a</CODE> will have the
value <CODE>"helloworld"</CODE> and not <CODE>"worldhello"</CODE>.
<P>Since adding or subtracting <CODE>1</CODE> from a variable is quite
common, <B>S-Lang</B> also supports the unary increment and decrement
operators <CODE>++</CODE>, and <CODE>--</CODE>, respectively.  That is, for
numeric data types, 
<BLOCKQUOTE><CODE>
<PRE>
       x = x + 1;
       x += 1;
       x++;
</PRE>
</CODE></BLOCKQUOTE>

are all equivalent.  Similarly,
<BLOCKQUOTE><CODE>
<PRE>
       x = x - 1;
       x -= 1;
       x--;
</PRE>
</CODE></BLOCKQUOTE>

are also equivalent.
<P>Strictly speaking, <CODE>++</CODE> and <CODE>--</CODE> are unary operators.  When
used as <CODE>x++</CODE>, the <CODE>++</CODE> operator is said to be a
<EM>postfix-unary</EM> operator.  However, when used as <CODE>++x</CODE> it is
said to be a <EM>prefix-unary</EM> operator.  The current
implementation does not distinguish between the two forms, thus
<CODE>x++</CODE> and <CODE>++x</CODE> are equivalent.  The reason for this
equivalence is <EM>that assignment expressions do not return a value in
the <B>S-Lang</B> language</EM> as they do in C.  Thus one should exercise care
and not try to write C-like code such as
<BLOCKQUOTE><CODE>
<PRE>
      x = 10;
      while (--x) do_something (x);     % Ok in C, but not in S-Lang
</PRE>
</CODE></BLOCKQUOTE>

The closest valid <B>S-Lang</B> form involves a <EM>comma-expression</EM>:
<BLOCKQUOTE><CODE>
<PRE>
      x = 10;
      while (x--, x) do_something (x);  % Ok in S-Lang and in C
</PRE>
</CODE></BLOCKQUOTE>
<P><B>S-Lang</B> also supports a <EM>multiple-assignment</EM> statement.  It is
discussed in detail in section ???.
<P>
<P>
<H2><A NAME="ss8.3">8.3 Conditional and Looping Statements</A>
</H2>

<P> 
<P><B>S-Lang</B> supports a wide variety of conditional and looping
statements.  These constructs operate on statements grouped together
in <EM>blocks</EM>.  A block is a sequence of <B>S-Lang</B> statements enclosed
in braces and may contain other blocks. However, a block cannot
include function declarations.  In the following,
<EM>statement-or-block</EM> refers to either a single
<B>S-Lang</B> statement or to a block of statements, and
<EM>integer-expression</EM> is an integer-valued expression.
<EM>next-statement</EM> represents the statement following the form
under discussion.
<P>
<H3>Conditional Forms</H3>

<P> 
<H3>if</H3>

<P>The simplest condition statement is the <CODE>if</CODE> statement.  It
follows the syntax
<BLOCKQUOTE><CODE>
if (<EM>integer-expression</EM>) <EM>statement-or-block</EM>
<EM>next-statement</EM>
</CODE></BLOCKQUOTE>

If <EM>integer-expression</EM> evaluates to a non-zero result, then the
statement or group of statements implied <EM>statement-or-block</EM>
will get executed.  Otherwise, control will proceed to
<EM>next-statement</EM>.
<P>An example of the use of this type of conditional statement is
<BLOCKQUOTE><CODE>
<PRE>
       if (x != 0) 
         {
            y = 1.0 / x;
            if (x &gt; 0) z = log (x);
         }
</PRE>
</CODE></BLOCKQUOTE>

This example illustrates two <CODE>if</CODE> statements where the second
<CODE>if</CODE> statement is part of the block of statements that belong to
the first.
<P>
<H3>if-else</H3>

<P>Another form of <CODE>if</CODE> statement is the <EM>if-else</EM> statement.
It follows the syntax:
<BLOCKQUOTE><CODE>
if (<EM>integer-expression</EM>) <EM>statement-or-block-1</EM>
else <EM>statement-or-block-2</EM>
<EM>next-statement</EM>
</CODE></BLOCKQUOTE>

Here, if <EM>expression</EM> returns non-zero,
<EM>statement-or-block-1</EM> will get executed and control will pass
on to <EM>next-statement</EM>. However, if <EM>expression</EM> returns zero,
<EM>statement-or-block-2</EM> will get executed before continuing with
<EM>next-statement</EM>.  A simple example of this form is
<BLOCKQUOTE><CODE>
<PRE>
     if (x &gt; 0) z = log (x); else error ("x must be positive");
</PRE>
</CODE></BLOCKQUOTE>

Consider the more complex example:
<BLOCKQUOTE><CODE>
<PRE>
     if (city == "Boston")
       if (street == "Beacon") found = 1;
     else if (city == "Madrid") 
       if (street == "Calle Mayor") found = 1;
     else found = 0;
</PRE>
</CODE></BLOCKQUOTE>

This example illustrates a problem that beginners have with
<EM>if-else</EM> statements.  The grammar presented above shows that
the this example is equivalent to
<BLOCKQUOTE><CODE>
<PRE>
     if (city == "Boston")
       {
         if (street == "Beacon") found = 1;
         else if (city == "Madrid")
           {
             if (street == "Calle Mayor") found = 1;
             else found = 0;
           }
       }
</PRE>
</CODE></BLOCKQUOTE>

It is important to understand the grammar and not be seduced by the
indentation!
<P>
<H3>!if</H3>

<P>
<P>One often encounters <CODE>if</CODE> statements similar to
<BLOCKQUOTE><CODE>
if (<EM>integer-expression</EM> == 0) <EM>statement-or-block</EM>
</CODE></BLOCKQUOTE>

or equivalently,
<BLOCKQUOTE><CODE>
if (not(<EM>integer-expression</EM>)) <EM>statement-or-block</EM>
</CODE></BLOCKQUOTE>

The <CODE>!if</CODE> statement was added to the language to simplify the
handling of such statements.  It obeys the syntax
<BLOCKQUOTE><CODE>
!if (<EM>integer-expression</EM>) <EM>statement-or-block</EM>
</CODE></BLOCKQUOTE>

and is functionally equivalent to
<BLOCKQUOTE><CODE>
if (not (<EM>expression</EM>)) <EM>statement-or-block</EM>
</CODE></BLOCKQUOTE>
<P>
<H3>orelse, andelse</H3>

<P>
<P>These constructs were discussed earlier.  The syntax for the
<CODE>orelse</CODE> statement is:
<BLOCKQUOTE><CODE>
orelse {<EM>integer-expression-1</EM>} ... {<EM>integer-expression-n</EM>}
</CODE></BLOCKQUOTE>

This causes each of the blocks to be executed in turn until one of
them returns a non-zero integer value.  The result of this statement
is the integer value returned by the last block executed.  For
example,
<BLOCKQUOTE><CODE>
<PRE>
     orelse { 0 } { 6 } { 2 } { 3 }
</PRE>
</CODE></BLOCKQUOTE>

returns <CODE>6</CODE> since the second block is the first to return a
non-zero result.  The last two block will not get executed.
<P>The syntax for the <CODE>andelse</CODE> statement is:
<BLOCKQUOTE><CODE>
andelse {<EM>integer-expression-1</EM>} ... {<EM>integer-expression-n</EM>}
</CODE></BLOCKQUOTE>

Each of the blocks will be executed in turn until one of
them returns a zero value.  The result of this statement is the
integer value returned by the last block executed.  For example,
<BLOCKQUOTE><CODE>
<PRE>
     andelse { 6 } { 2 } { 0 } { 4 }
</PRE>
</CODE></BLOCKQUOTE>

returns <CODE>0</CODE> since the third block will be the last to execute.
<P>
<H3>switch</H3>

<P>The switch statement deviates the most from its C counterpart.  The
syntax is:
<BLOCKQUOTE><CODE>
<PRE>
          switch (x)
            { ...  :  ...}
              .
              .
            { ...  :  ...}
</PRE>
</CODE></BLOCKQUOTE>

The `<CODE>:</CODE>' operator is a special symbol which means to test
the top item on the stack, and if it is non-zero, the rest of the block
will get executed and control will pass out of the switch statement.
Otherwise, the execution of the block will be terminated and the process
will be repeated for the next block.  If a block contains no
<CODE>:</CODE> operator, the entire block is executed and control will
pass onto the next statement following the <CODE>switch</CODE> statement.
Such a block is known as the <EM>default</EM> case.
<P>As a simple example, consider the following:
<BLOCKQUOTE><CODE>
<PRE>
      switch (x)
        { x == 1 : print("Number is one.");}
        { x == 2 : print("Number is two.");}
        { x == 3 : print("Number is three.");}
        { x == 4 : print("Number is four.");}
        { x == 5 : print("Number is five.");}
        { print ("Number is greater than five.");}
</PRE>
</CODE></BLOCKQUOTE>

Suppose <CODE>x</CODE> has an integer value of <CODE>3</CODE>.  The first two
blocks will terminate at the `<CODE>:</CODE>' character because each of the
comparisons with <CODE>x</CODE> will produce zero.  However, the third
block will execute to completion.  Similarly, if <CODE>x</CODE> is
<CODE>7</CODE>, only the last block will execute in full.
<P>A more familiar way to write the previous example used the
<CODE>case</CODE> keyword:
<BLOCKQUOTE><CODE>
<PRE>
      switch (x)
        { case 1 : print("Number is one.");}
        { case 2 : print("Number is two.");}
        { case 3 : print("Number is three.");}
        { case 4 : print("Number is four.");}
        { case 5 : print("Number is five.");}
        { print ("Number is greater than five.");}
</PRE>
</CODE></BLOCKQUOTE>

The <CODE>case</CODE> keyword is a more useful comparison operator because
it can perform a comparison between different data types while
using <CODE>==</CODE> may result in a type-mismatch error.  For example,
<BLOCKQUOTE><CODE>
<PRE>
      switch (x)
        { (x == 1) or (x == "one") : print("Number is one.");}
        { (x == 2) or (x == "two") : print("Number is two.");}
        { (x == 3) or (x == "three") : print("Number is three.");}
        { (x == 4) or (x == "four") : print("Number is four.");}
        { (x == 5) or (x == "five") : print("Number is five.");}
        { print ("Number is greater than five.");}
</PRE>
</CODE></BLOCKQUOTE>

will fail because the <CODE>==</CODE> operation is not defined between
strings and integers.  The correct way to write this to use the
<CODE>case</CODE> keyword:
<BLOCKQUOTE><CODE>
<PRE>
      switch (x)
        { case 1 or case "one" : print("Number is one.");}
        { case 2 or case "two" : print("Number is two.");}
        { case 3 or case "three" : print("Number is three.");}
        { case 4 or case "four" : print("Number is four.");}
        { case 5 or case "five" : print("Number is five.");}
        { print ("Number is greater than five.");}
</PRE>
</CODE></BLOCKQUOTE>
<P>
<P>
<H3>Looping Forms</H3>

<P> 
<P>
<H3>while</H3>

<P>The <CODE>while</CODE> statement follows the syntax
<BLOCKQUOTE><CODE>
while (<EM>integer-expression</EM>) <EM>statement-or-block</EM>
<EM>next-statement</EM>
</CODE></BLOCKQUOTE>

It simply causes <EM>statement-or-block</EM> to get executed as long as
<EM>integer-expression</EM> evaluates to a non-zero result.  For
example, 
<BLOCKQUOTE><CODE>
<PRE>
      i = 10; 
      while (i) 
        {
          i--;
          newline ();
        }
</PRE>
</CODE></BLOCKQUOTE>

will cause the <CODE>newline</CODE> function to get called 10 times.
However, 
<BLOCKQUOTE><CODE>
<PRE>
      i = -10;
      while (i) 
        {
          i--;
          newline ();
        }
</PRE>
</CODE></BLOCKQUOTE>

would loop forever (or until <CODE>i</CODE> wraps from the most negative
integer value to the most positive and then decrements to zero).
<P>
<P>If you are a C programmer, do not let the syntax of the language
seduce you into writing this example as you would in C:
<BLOCKQUOTE><CODE>
<PRE>
      i = 10;
      while (i--) newline ();
</PRE>
</CODE></BLOCKQUOTE>

The fact is that expressions such as <CODE>i--</CODE> do not return a
value in <B>S-Lang</B> as they do in C.  If you must write this way, use
the comma operator as in
<BLOCKQUOTE><CODE>
<PRE>
      i = 10;
      while (i, i--) newline ();
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H3>do...while</H3>

<P>The <CODE>do...while</CODE> statement follows the syntax
<BLOCKQUOTE><CODE>
do 
<EM>statement-or-block</EM>
while (<EM>integer-expression</EM>);
</CODE></BLOCKQUOTE>

The main difference between this statement and the <CODE>while</CODE>
statement is that the <CODE>do...while</CODE> form performs the test
involving <EM>integer-expression</EM> after each execution
of <EM>statement-or-block</EM> rather than before.  This guarantees that
<EM>statement-or-block</EM> will get executed at least once.
<P>A simple example from the <B>jed</B> editor follows:
<BLOCKQUOTE><CODE>
<PRE>
     bob ();      % Move to beginning of buffer
     do
       {
          indent_line ();
       }
     while (down (1));
</PRE>
</CODE></BLOCKQUOTE>

This will cause all lines in the buffer to get indented via the
<B>jed</B> intrinsic function <CODE>indent_line</CODE>.
<P>
<H3>for</H3>

<P>Perhaps the most complex looping statement is the <CODE>for</CODE>
statement; nevertheless, it is a favorite of many programmers.
This statement obeys the syntax
<BLOCKQUOTE><CODE>
for (<EM>init-expression</EM>; <EM>integer-expression</EM>; <EM>end-expression</EM>) 
<EM>statement-or-block</EM>
<EM>next-statement</EM>
</CODE></BLOCKQUOTE>

In addition to <EM>statement-or-block</EM>, its specification requires
three other expressions.  When executed, the <CODE>for</CODE> statement
evaluates <EM>init-expression</EM>, then it tests
<EM>integer-expression</EM>.  If <EM>integer-expression</EM> returns zero,
control passes to <EM>next-statement</EM>.  Otherwise, it executes
<EM>statement-or-block</EM> as long as <EM>integer-expression</EM>
evaluates to a non-zero result.  After every execution of
<EM>statement-or-block</EM>, <EM>end-expression</EM> will get evaluated.
<P>This statement is <EM>almost</EM> equivalent to 
<BLOCKQUOTE><CODE>
<EM>init-expression</EM>;
while (<EM>integer-expression</EM>)
{
<EM>statement-or-block</EM>
<EM>end-expression</EM>;
}
</CODE></BLOCKQUOTE>

The reason that they are not fully equivalent involves what happens
when <EM>statement-or-block</EM> contains a <CODE>continue</CODE> statement.
<P>Despite the apparent complexity of the <CODE>for</CODE> statement, it is
very easy to use.  As an example, consider
<BLOCKQUOTE><CODE>
<PRE>
     sum = 0;
     for (i = 1; i &lt;= 10; i++) sum += i;
</PRE>
</CODE></BLOCKQUOTE>

which computes the sum of the first 10 integers.
<P>
<H3>loop</H3>

<P>The <CODE>loop</CODE> statement simply executes a block of code a fixed
number of times.  It follows the syntax
<BLOCKQUOTE><CODE>
loop (<EM>integer-expression</EM>) <EM>statement-or-block</EM>
<EM>next-statement</EM>
</CODE></BLOCKQUOTE>

If the <EM>integer-expression</EM> evaluates to a positive integer,
<EM>statement-or-block</EM> will get executed that many times.
Otherwise, control will pass to <EM>next-statement</EM>.
<P>For example,
<BLOCKQUOTE><CODE>
<PRE>
      loop (10) newline ();
</PRE>
</CODE></BLOCKQUOTE>

will cause the function <CODE>newline</CODE> to get called 10 times.
<P>
<H3>forever</H3>

<P>The <CODE>forever</CODE> statement is similar to the <CODE>loop</CODE> statement
except that it loops forever, or until a <CODE>break</CODE> or a
<CODE>return</CODE> statement is executed.  It obeys the syntax
<BLOCKQUOTE><CODE>
forever <EM>statement-or-block</EM>
</CODE></BLOCKQUOTE>

A trivial example of this statement is
<BLOCKQUOTE><CODE>
<PRE>
     n = 10;
     forever
       {
          if (n == 0) break;
          newline ();
          n--;
       }
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H3>foreach</H3>

<P>The <CODE>foreach</CODE> statement is used to loop over one or more
statements for every element in a container object.  A container
object is a data type that consists of other types.  Examples
include both ordinary and associative arrays, structures, and
strings.  Every time through the loop the current member of the
object is pushed onto the stack.
<P>The simple type of <CODE>foreach</CODE> statement obeys the syntax
<BLOCKQUOTE><CODE>
foreach (<EM>container-object</EM>) <EM>statement-or-block</EM>
</CODE></BLOCKQUOTE>

Here <EM>container-object</EM> can be an expression that returns a
container object.  A simple example is
<BLOCKQUOTE><CODE>
<PRE>
     foreach (["apple", "peach", "pear"])
      {
         fruit = ();
         process_fruit (fruit);
      } 
</PRE>
</CODE></BLOCKQUOTE>

This example shows that if the container object is an array, then
successive elements of the array are pushed onto the stack prior to
each execution cycle.  If the container object is a string, then
successive characters of the string are pushed onto the stack.
<P>What actually gets pushed onto the stack may be controlled via the
<CODE>using</CODE> form of the <CODE>foreach</CODE> statement.  This more complex
type of <CODE>foreach</CODE> statement follows the syntax
<BLOCKQUOTE><CODE>
foreach ( <EM>container-object</EM> ) using ( <EM>control-list</EM> ) 
<EM>statement-or-block</EM>
</CODE></BLOCKQUOTE>

The allowed values of <EM>control-list</EM> will depend upon the type
of container object.  For associative arrays (<CODE>Assoc_Type</CODE>),
<EM>control-list</EM> specified whether <EM>keys</EM>, <EM>values</EM>, or both
are pushed onto the stack.  For example,
<BLOCKQUOTE><CODE>
<PRE>
     foreach (a) using ("keys") 
       {
          k = ();
           .
           .
       }
</PRE>
</CODE></BLOCKQUOTE>

results in the keys of the associative array <CODE>a</CODE> being pushed
on the list.  However, 
<BLOCKQUOTE><CODE>
<PRE>
     foreach (a) using ("values")
       {
          v = ();
           .
           .
       }
</PRE>
</CODE></BLOCKQUOTE>

will cause the values to be used, and
<BLOCKQUOTE><CODE>
<PRE>
     foreach (a) using ("keys", "values")
       {
          (k,v) = ();
           .
           .
       }
</PRE>
</CODE></BLOCKQUOTE>

will use both the keys and values of the array.
<P>Similarly, for linked-lists of structures, one may walk the list via
code like
<BLOCKQUOTE><CODE>
<PRE>
     foreach (linked_list) using ("next")
       {
          s = ();
            .
            .
       }
</PRE>
</CODE></BLOCKQUOTE>

This <CODE>foreach</CODE> statement is equivalent
<BLOCKQUOTE><CODE>
<PRE>
     s = linked_list;
     while (s != NULL)
       {
          .
          .
         s = s.next;
       }
</PRE>
</CODE></BLOCKQUOTE>

Consult the type-specific documentation for a discussion of the
<CODE>using</CODE> control words, if any, appropriate for a given type.
<P>
<H2><A NAME="ss8.4">8.4 break, return, continue</A>
</H2>

<P>
<P><B>S-Lang</B> also includes the non-local transfer functions <CODE>return</CODE>, <CODE>break</CODE>,
and <CODE>continue</CODE>.  The <CODE>return</CODE> statement causes control to return to the
calling function while the <CODE>break</CODE> and <CODE>continue</CODE> statements are used in
the context of loop structures.  Consider:
<BLOCKQUOTE><CODE>
<PRE>
       define fun ()
       {
          forever
            {
               s1;
               s2;
               ..
               if (condition_1) break;
               if (condition_2) return;
               if (condition_3) continue;
               ..
               s3;
            }
          s4;
          ..
       }
</PRE>
</CODE></BLOCKQUOTE>

Here, a function <CODE>fun</CODE> has been defined that contains a <CODE>forever</CODE>
loop consisting of statements <CODE>s1</CODE>, <CODE>s2</CODE>,...,<CODE>s3</CODE>, and
three <CODE>if</CODE> statements.  As long as the expressions <CODE>condition_1</CODE>,
<CODE>condition_2</CODE>, and <CODE>condition_3</CODE> evaluate to zero, the statements
<CODE>s1</CODE>, <CODE>s2</CODE>,...,<CODE>s3</CODE> will be repeatedly executed.  However,
if <CODE>condition_1</CODE> returns a non-zero value, the <CODE>break</CODE> statement
will get executed, and control will pass out of the <CODE>forever</CODE> loop to
the statement immediately following the loop which in this case is
<CODE>s4</CODE>. Similarly, if <CODE>condition_2</CODE> returns a non-zero number,
the <CODE>return</CODE> statement will cause control to pass back to the
caller of <CODE>fun</CODE>.  Finally, the <CODE>continue</CODE> statement will
cause control to pass back to the start of the loop, skipping the
statement <CODE>s3</CODE> altogether.
<P>
<P>
<P>
<P>
<P>
<HR>
<A HREF="slang-9.html">Next</A>
<A HREF="slang-7.html">Previous</A>
<A HREF="slang.html#toc8">Contents</A>
</BODY>
</HTML>