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.