While - Texas Instruments TI-NSPIRE Software Manual

Cas computer software
Hide thumbs Also See for TI-NSPIRE:
Table of Contents

Advertisement

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
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 variable is incremented and compared to
For example:
For i,0,5,1
À
Disp i
EndFor
Á
Disp i
À
Displays 0, 1, 2, 3, 4, and 5.
Á
Displays 6. When variable increments to 6, the loop is not executed.
Note: You can declare the counter variable as local if it does not need to
be saved after the function or program stops.
While...EndWhile loops
A
While...EndWhile
specified condition is true. The syntax of the
338
Â
Ã
For i,0,5,1
{
i
5
--------
--------
EndFor
--------
), control jumps back to the
EndFor
loop repeats a block of commands as long as a
is executed
For
For
.
EndFor
end

While

is executed (If this
command,
For
.
command is:
Programming

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-nspire

Table of Contents