Defining The Scope Of Local Variables - HP 48gII Advanced User's Reference Manual

Graphing calculator
Hide thumbs Also See for 48gII:
Table of Contents

Advertisement

When a local name is evaluated, the object stored in the corresponding variable is returned to the stack but is
not evaluated.When a local variable contains a number, the effect is identical to evaluation of a global name,
since putting a number on the stack is equivalent to evaluating it. However, if a local variable contains a
program, algebraic expression, or global variable name — and if you want it evaluated — the program should
execute EVAL after the object is put on the stack.

Defining the Scope of Local Variables

Local variables exist only inside the defining procedure.
Example:
The following program excerpt illustrates the availability of local variables in nested defining
procedures (procedures within procedures). Because local variables a, b, and c already exist when the defining
procedure for local variables d, e, and f is executed, they're available for use in that procedure.
Program:
«
.
.
.
 a b c
«
a b + c +
 d e f
'a/(d*e+f)'
»
.
.
.
»
a c / -
Comments:
No local variables are available.
Defines local variables a, b, c.
Local variables a, b, c are
available in this procedure.
Defines local variables d, e, f.
Local variables a, b, c and d, e, f
are available in this procedure.
Only local variables a, b, c are
available.
No local variables are available.
RPL Programming 1-9

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

49g+

Table of Contents