Reference.While History

Hide minor edits - Show changes to output

September 04, 2012, at 11:23 PM by Scott Fitzgerald - added link to the while loop tutorial
Changed line 18 from:
[@
to:
(:source lang=arduino:)
Changed lines 24-28 from:
@]
to:
(:sourceend:)

!!!! See Also
* [[ /Tutorial/WhileLoop | While Loop Tutorial]]
\\
May 26, 2007, at 02:05 PM by Paul Badger -
Changed lines 5-6 from:
'''While''' loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable, or the '''while''' loop will never exit. This could be in your code, such as an incremented variable, or an external condition, such as testing a sensor.
to:
'''while''' loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable, or the '''while''' loop will never exit. This could be in your code, such as an incremented variable, or an external condition, such as testing a sensor.
May 26, 2007, at 02:05 PM by Paul Badger -
Changed lines 1-2 from:
!While statements
to:
!!while loops
May 05, 2007, at 02:37 PM by Paul Badger -
Changed lines 5-6 from:
'''While''' loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable, or the '''while''' loop will never exit. This could be in your code such as an incremented variable, or an external condition such as testing a sensor.
to:
'''While''' loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable, or the '''while''' loop will never exit. This could be in your code, such as an incremented variable, or an external condition, such as testing a sensor.
May 05, 2007, at 02:36 PM by Paul Badger -
Changed lines 5-6 from:
'''While''' loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something inside the loop must change the tested variable, or the '''while''' loop will never exit.
to:
'''While''' loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable, or the '''while''' loop will never exit. This could be in your code such as an incremented variable, or an external condition such as testing a sensor.
April 17, 2007, at 12:01 AM by David A. Mellis -
Changed line 9 from:
// statement(s);
to:
// statement(s)
April 17, 2007, at 12:01 AM by David A. Mellis -
Changed line 9 from:
// #statement(s)
to:
// statement(s);
April 17, 2007, at 12:01 AM by David A. Mellis -
Changed lines 9-11 from:

#statement(s)
to:
// #statement(s)
April 16, 2007, at 05:48 PM by Paul Badger -
Changed lines 3-6 from:
Loops continuously until the expression inside () are not true. Useful for creating your own loops, but make sure to keep track of some variable you can use to stop the while loop if that is your intent.

!!! Example
to:
!!!!Description

'''While''' loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something inside the loop must change the tested variable, or the '''while''' loop will never exit.

!!!!Syntax
[@while(expression){

#statement(s)

}@]

!!!!Parameters

expression - a (boolean) C statement that evaluates to true or false

!!!! Example
Changed line 23 from:
//do something repetitive 200 times
to:
// do something repetitive 200 times
March 26, 2006, at 10:34 PM by Jeff Gray -
Added lines 1-13:
!While statements

Loops continuously until the expression inside () are not true. Useful for creating your own loops, but make sure to keep track of some variable you can use to stop the while loop if that is your intent.

!!! Example

[@
var = 0;
while(var < 200){
//do something repetitive 200 times
var++;
}
@]

Share