EasyManuals Logo
Home>Texas Instruments>Calculator>TINSPIRE

Texas Instruments TINSPIRE User Manual

Texas Instruments TINSPIRE
876 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #702 background imageLoading...
Page #702 background image
690 Programming
Note: Displaying a result with or does not store that result. If you
expect to refer later to a result, store it to a global variable.
Using local variables
A local variable is a temporary variable that exists only while a user-
defined function is being evaluated or a user-defined program is
running.
Example of a local variable
The following program segment shows a For...EndFor loop (which is
discussed later in this module). The variable i is the loop counter. In most
cases, the variable i is used only while the program is running.
À Declares variable i as local.
Note: When possible, declare as local any variable that is used only
within the program and does not need to be available after the program
stops.
What causes an undefined variable error message?
An Undefined variable error message displays when you evaluate a user-
defined function or run a user-defined program that references a local
variable that is not initialized (assigned a value).
For example:
À Local variable m is not assigned an initial value.
©
(p/4)&maximum
maximum
©
Local i À
For i,0,5,1
Disp i
EndFor
Disp i
Define fact(n)=Func
Local m
À
While n>1
n
¦m&m: n–1&n
EndWhile
Return m
EndFunc

Table of Contents

Other manuals for Texas Instruments TINSPIRE

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TINSPIRE and is the answer not in the manual?

Texas Instruments TINSPIRE Specifications

General IconGeneral
BrandTexas Instruments
ModelTINSPIRE
CategoryCalculator
LanguageEnglish

Related product manuals