Texas Instruments TINSPIRE Manual Book page 709

Teacher software guidebook
Hide thumbs Also See for TINSPIRE:
Table of Contents

Advertisement

Loop and loop-related commands reside on the Program Editor's
and
menus.
Transfers
When you insert one of the loop structures, its template is inserted at the
cursor location. You can then begin entering the commands that will be
executed within the loop.
For...EndFor loops
A
loop uses a counter to control the number of times the
For...EndFor
loop is repeated. The syntax of the
Note: The ending value can be less than the beginning value, provided
the increment is negative.
variable
, begin , end [, increment ]
For
À
À
Variable used as a counter
Á
Counter value used the first time
Â
Exits the loop when variable exceeds this value
Ã
Added to the counter each subsequent time
optional value is omitted, the increment is 1.)
is executed, the variable value is compared to the end value. If
When
For
variable does not exceed end, the loop is executed; otherwise, control
jumps to the command following
{
i
5
i > 5
Note: The
command automatically increments the counter variable
For
so that the function or program can exit the loop after a certain number
of repetitions.
At the end of the loop (
where the variable is incremented and compared to
For example:
Á
Â
Ã
For i,0,5,1
--------
--------
EndFor
--------
), control jumps back to the
EndFor
command is:
For
is executed
For
For
.
EndFor
Control
is executed (If this
command,
For
end
.
Programming
697

Advertisement

Table of Contents
loading

Table of Contents