27220 Parallax Inc, 27220 Datasheet - Page 25

BOOK STAMPWORKS

27220

Manufacturer Part Number
27220
Description
BOOK STAMPWORKS
Manufacturer
Parallax Inc
Datasheet

Specifications of 27220

Accessory Type
Booklet
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
StampWorks
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Not applicable / Not applicable
In the second example, the loop statements will run at least once, even if the
condition evaluates as False. As you can see, the strength of DO-LOOP is that it
simplifies how and where the condition testing occurs.
DO-LOOP adds another type of testing with UNTIL.
By using UNTIL, the loop statements will run while the condition evaluates as False.
And, as demonstrated earlier, placing the test at the end of the loop will cause the
loop statements to run at least one time.
Another example of looping is the programmed loop using FOR-NEXT.
The FOR-NEXT construct is used to run a section of code a specific number of times.
FOR-NEXT uses a control variable to determine the number of loop iterations. The
size of the variable will determine the upper limit of loop iterations. For example, the
upper limit when using a byte-sized control variable would be 255. In the example
below, controlVar could be defined as a Nib (4-bit) variable as the end value is
less than 16:
FOR controlVar = startVal TO endVal STEP stepSize
NEXT
FOR controlVar = 1 TO 10
NEXT
DO
LOOP UNTIL (condition)
DO UNTIL (condition)
LOOP
statement 1
statement 2
statement 3
statement 1
statement 2
statement 3
statement 1
statement 2
statement 3
statement 1
statement 2
statement 3

Related parts for 27220