|
A type
of loop
statement
in programming
that performs pre-defined tasks
while or until a pre-determined condition is met. For example, in Perl
you may use a for loop similar to the below example that prints
"Computer Hope" five times.
for ($i = 1; $i < 6; $i++)
{
print "Computer Hope\n";
} |
In the above example, the for loop first sets the variable $i to a
value of 1; each time it executes, the $i variable is increased by 1, while it is less than 6
"Computer Hope" is printed to the screen.
See our MS-DOS for command page
if you're looking for additional information about the MS-DOS for
command.
Also see: Do, Foreach,
Loop,
Programming definitions, While
|
|
| Resolved | Were you able to locate the answer to your questions? |
|
|