You Must Initialize Local Variables - Texas Instruments TI-89 Titanium User Manual

Hide thumbs Also See for TI-89 Titanium:
Table of Contents

Advertisement

In the example above, the local variable
exists outside of the function.

You Must Initialize Local Variables

All local variables must be assigned an initial value before they are referenced.
Define fact(n)=Func:
Ê
Local m: 1!m:
While n>1:
nùm!m: n–1!n:
EndWhile:
Return m:
EndFunc
Ê
1 is stored as the initial value for m.
The calculator cannot use a local variable to perform symbolic calculations.
To Perform Symbolic Calculations
If you want a function or program to perform symbolic calculations, you must use a
global variable instead of a local. However, you must be certain that the global variable
does not already exist outside of the program. The following methods can help.
Refer to a global variable name, typically with two or more characters, that is not
likely to exist outside of the function or program.
Include
DelVar
before referring to it. (
Programming
within the function or program to delete the global variable, if it exists,
does not delete locked or archived variables.)
DelVar
exists independently of any variable
m
that
m
584

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents