Programming
697
Loop and loop-related commands reside on the Program Editor’s
Control
and
Transfers
menus.
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
For...EndFor
loop uses a counter to control the number of times the
loop is repeated. The syntax of the
For
command is:
Note:
The ending value can be less than the beginning value, provided
the increment is negative.
For
variable
,
begin
,
end
[,
increment
]
À
Variable
used as a counter
Á
Counter value used the first time
For
is executed
Â
Exits the loop when
variable
exceeds this value
Ã
Added to the counter each subsequent time
For
is executed (If this
optional value is omitted, the
increment
is 1.)
When
For
is executed, the
variable
value is compared to the
end
value. If
variable
does not exceed
end
, the loop is executed; otherwise, control
jumps to the command following
EndFor
.
Note:
The
For
command automatically increments the counter variable
so that the function or program can exit the loop after a certain number
of repetitions.
At the end of the loop (
EndFor
), control jumps back to the
For
command,
where the variable is incremented and compared to
end
.
For example:
À
Á
Â
Ã
i > 5
i
{
5
For i,0,5,1
--------
--------
EndFor
--------
Summary of Contents for TI-Nspire
Page 38: ...26 Setting up the TI Nspire Navigator Teacher Software ...
Page 46: ...34 Getting started with the TI Nspire Navigator Teacher Software ...
Page 84: ...72 Using the Content Workspace ...
Page 180: ...168 Capturing Screens ...
Page 256: ...244 Embedding documents in web pages ...
Page 336: ...324 Polling students ...
Page 374: ...362 Using the Review Workspace ...
Page 436: ...424 Calculator ...
Page 450: ...438 Using Variables ...
Page 602: ...590 Using Lists Spreadsheet ...
Page 676: ...664 Using Notes You can also change the sample size and restart the sampling ...
Page 684: ...672 Libraries ...
Page 714: ...702 Programming ...
Page 828: ...816 Data Collection and Analysis ...
Page 846: ...834 Regulatory Information ...
Page 848: ...836 ...