[7.40] Recall Expression Without Variable Value Substitution - Texas Instruments TI-89 Tip List

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

Advertisement

This program deletes variables which are locked, archived or both. The order of the unarchiv and
unlock commands is important, because a variable must be unarchived before it is unlocked, or a
"Memory" error occurs. This program works because no errors occur if you unlock or unarchive a
variable which is already unlocked or unarchived. This means that the program can also be used as a
quick way to delete a list of variables which are not locked or archived.
The unarchiv and unlock commands are used in Try ... EndTry blocks, otherwise an error occurs if you
try to delete system variables. Many system variables can be deleted, and it is often useful to do so.
This program should obviously be used with some care, since there are no prompts to verify that you
really want to delete the variables.

[7.40] Recall expression without variable value substitution

You can use the RCL operation ([2nd] [STO] on the TI-89 and TI-92+) to recall an expression without
substituting variable values. For example, suppose you store an equation to eqn1:
a+b=c→eqn1
then if you evaluate eqn1 at the entry line, the result a+b=c is returned as expected. However, if you
store numeric values to 1, 2, and 3 to a, b and c, respectively, then evaluating eqn1 returns true, since
1+2 = 3. You can recall the original expression and avoid the variable value substitution with [RCL].
This operation can be accomplished in a TI Basic program, but the RCL operation is not
programmable. Instead, we need to use a different method, as this code example shows.
rclexpr(ë)
Prgm
local ö,ü
Try:newFold(ä):else:endTry
setFold(ä)→ö
#ë→ü
setFold(#ö)
util\copyto_h("ü")
EndPrgm
The expression is evaluated in a folder in which the variables do not exist, so substitution cannot take
place. The expression is returned as a string, otherwise the variable values would be substituted. The
argument ë is a string which specifies the variable and its folder. The folder must be specified, since
the expression is evaluated in a different folder. As an example, suppose that the variable eqn1 and
the variables a, b and c are all in the main\ folder. If rclexpr() is in the util\ folder, then the call to get the
expression in eqn1 is
util\rclexpr("main\eqn1")
and the history display looks like this after execution:
© Create new folder if necessary
© Make new folder current and save old folder
© Evaluate expression
© Restore old folder
© Return expression as a string
7 - 40

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92+

Table of Contents