These work the same as do while loops only they execute until the condition evaluated is true
Here's a quick example:
This is executes once and prints out $value;
5
Then $value is decremented and becomes 4
since 4<=10 is true execution of the loop is terminated
Now onto the exciting world of for loops
Here's a quick example:
$value=5; do{ print "$value\n"; $value=$value-1; } until($value<=10);
This is executes once and prints out $value;
5
Then $value is decremented and becomes 4
since 4<=10 is true execution of the loop is terminated
Now onto the exciting world of for loops
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: do until loops
by Anonymous Monk on Jul 07, 2001 at 01:27 UTC | |
by rlivings (Acolyte) on Aug 01, 2001 at 14:12 UTC | |
by Anonymous Monk on Mar 20, 2002 at 07:18 UTC | |
Re: do until loops
by Anonymous Monk on Aug 20, 2002 at 15:23 UTC | |
by Abigail-II (Bishop) on Aug 20, 2002 at 15:40 UTC | |
by Anonymous Monk on Sep 19, 2002 at 11:35 UTC | |
by Anonymous Monk on Feb 17, 2014 at 12:24 UTC | |
by Athanasius (Archbishop) on Feb 17, 2014 at 14:25 UTC | |
by Anonymous Monk on Sep 09, 2003 at 23:09 UTC |
Back to
Tutorials