692
Programming
•
A function can refer to any variable; however, it can store a value to a
local variable only. Programs can store to local and global variables.
Note:
Arguments used to pass values to a function are treated as
local variables automatically. If you want to store to any other
variables, you must declare them as
Local
from within the function.
•
A function cannot call a program as a subroutine, but it can call
another user-defined function.
•
You cannot define a program within a function.
•
A function cannot define a global function, but it can define a local
function.
Calling one program from another
One program can call another program as a subroutine. The subroutine
can be external (a separate program) or internal (included in the main
program). Subroutines are useful when a program needs to repeat the
same group of commands at several different places.
Calling a separate program
To call a separate program, use the same syntax that you use to run the
program from the entry line.
Defining and calling an internal subroutine
To define an internal subroutine, use the
Define
command with
Prgm...EndPrgm
. Because a subroutine must be defined before it can be
called, it is a good practice to define subroutines at the beginning of the
main program.
An internal subroutine is called and executed in the same way as a
separate program.
Define subtest1()=
Prgm
For i,1,4,1
subtest2(i,i
¦
1000)
EndFor
EndPrgm
Define subtest2(x,y)=
Prgm
Disp x,y
EndPrgm
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 ...