next up previous contents index
Next: Example: Switch Control Up: Control Statements Previous: Example: A Simple

Example: A Double Loop with Exit Condition

  The conditional statement forces a user to exit both loops if the condition is satisfied.
for $1 in ( a b c d e ) loop m1
  while ($2 > 10.0 ) loop m2
     if ($3>1000.0) then  exit  m1  end if 
     evaluate ($2=$2-1.0)
  end loop m2
end loop m1


Web Manager
Sat Mar 11 09:37:37 PST 1995