Programming
583
Ê
Declares variable
i
as local.
Note:
As often as possible, use local variables for any variable that is used only within a
program and does not need to be stored after the program stops.
If you declare variable
i
as local, it is deleted automatically when the program stops so
that it does not use up memory.
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).
This example is a multi-statement function, rather than a program. Line breaks are
shown here, but you would type the text in the entry line as one continuous line, such as:
Define fact(n)=Func:Local…
where the ellipsis indicates the entry line text continues off-
screen.
For example:
Ê
Local variable
m
is not assigned an initial value.
Ê
Define fact(n)=Func:
Local m:
While n>1:
n
†
m
!
m: n–1
!
n:
EndWhile:
Return m:
EndFunc
Summary of Contents for Titanium TI-89
Page 9: ...Getting Started 6 TI 89 Titanium keys Ë Ì Í Ê ...
Page 34: ...Getting Started 31 2 or D 2 B u s i n e s s D B D B Press Result ...
Page 43: ...Getting Started 40 3 0 D B D D B D Press Result ...
Page 44: ...Getting Started 41 D 2 0 0 2 D B Scroll down to October and press Press Result ...
Page 58: ...Getting Started 55 Example Set split screen mode to TOP BOTTOM Press Result 3 B D ...
Page 70: ...Getting Started 67 ...
Page 175: ...Operating the Calculator 172 From the Keyboard ...
Page 456: ...Tables 453 ...
Page 527: ...Data Matrix Editor 524 ...