HP 48g Graphing Calculator User Manual
Page 409
Attention! The text in this document has been recognized automatically. To view the original document, you can use the "Original mode".
Examples of Program Actions
Program
Results
■ i: 1 2 :i-
1
!!
"H e llo " i fl B
2 :
"H e llo "
1
«
H
P>
■ s ’1 + 2 ’ :i-
U 'l+
2
‘
■ s ’1 + 2 ’ + H U M
:*■
1 2 3
« s
1
2
+ :+ :«■
is
«
1
2
+ :«•
« «
1 2
+ s- EvFlL :*•
1 - 3
Actually, programs can contain more than just objects—they can also
contain struciures. A structure is a program segment with a defined
organization. Two basic kinds of structures are available:
■ Local variable structure. The ^ command defines local variable
names and a corresponding algebraic or program object that’s
evaluated using those variables.
B Branching structures. Structure words (like DO...UNTIL...END)
define conditional or loop structures to control the order of
execution within a program.
A local variable structure has one of the following organizations inside
a program;
■ K -s- nainei ... name^ 'algebraic' :*■
■ i: -i- name I ... name^ « program :s- :*■
The command removes n objects from the stack and stores them
in the named local variables. The algebraic or program object in
the structure is automatically evaluated because it’s an element of
the structure—even though algebraic and program objects are put
on the stack in other situations. Each time a local variable name
appears in the algebraic or program object, the variable’s contents are
substituted.
29
Programming the HP 48 29-3