The rules for evaluating names and evaluating programs lead to one
of the fundamental ideas in programming the HP-28S. For this dis-
cussion, "program" means a program storeq in a variable, and "name
of a program" means the name of the variable that contains a
The fundamental idea is called
It means that a
complicated task is broken into subtasks, and a program is written for
each sub task. The main program can now be relatively simple, reflect-
ing the overall logic of the task. It can execute each subtask simply by
including the unquoted name of the program for that subtask. If a
subtask is executed more than once, the unquoted name can be in-
cluded more than once. If other main programs use the same subtask,
they can execute the subtask in the same way.
Structured programming is demonstrated in "Expanding and Collect-
ing Completely" on page 253, "Displaying a Binary Integer" on page
257, and "Median of Statistics Data" on page 270.
Evaluation of Aigebraics
Each algebraic is equivalent to a program that contains only unquoted
names and functions. Evaluating an algebraic produces the same re-
sult as evaluating the corresponding program: unquoted names are
evaluated, and functions are executed. This topic is also discussed in
"Evaluation of Algebraic Objects" in the Reference Manual.
The result of evaluating a name depends on the existence of a vari-
able with that name, as described in "Evaluation of Global Names"
above. Some examples:
• If a name refers to a user function, you can use the user function's
name like a built-in function. Evaluation of the algebraic causes
execution of the user function. The arguments to the user function,
enclosed in parentheses and following the user function's name, are
part of the algebraic.