dowhile statement

Purpose: dowhile statement is similar to while loop except the condition is tested after the statements are executed.

Status: Done. Nesting is not supported at the moment.

Syntax:

   dowhile condition
   ...
   end

Let's see some example of dowhile statement

Example 1:

   param a=3
   dowhile a<3
      eval(a)
   end

Output:

   gnucap> a=3.

Example 2:

   param a=3
   dowhile a>1
     eval(a)
     echo after decrement
     measure a eval(a-1)
   end

Output:

    gnucap> a= 3.
            after decrement
            a= 2.
            a= 2.
            after decrement
            a= 1.    
gnucap/user/dowhile_statement.txt · Last modified: 2015/12/11 15:39 (external edit)
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Run by Debian Driven by DokuWiki