repeat statement

Purpose: This command executes the statements defined within its body “n” number of times where n is the number passed by the user.If no number is passed,loop is executed infinite number of times.

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

Syntax:

   repeat [n]
   ...
   end

Let's see some examples of this command.

Example 1:

 repeat 3
 echo Hello World!!
 end

Output:

      gnucap> Hello World!!
              Hello World!!
              Hello World!!

Example 2:

repeat
echo This statements will run infinite times.
end

Output:

       gnucap>This statement will run infinite times.
              This statement will run infinite times.

and,this statement will continue executing……..infinite times!!

gnucap/user/repeat_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