Download Print this page

HP -42S Manual page 20

Hewlett-packard owner's manual
Hide thumbs Also See for HP-42S:

Advertisement

1 STO 00
5 +/- STO 01
4 STO 02
Now we just press R/S (to run the program) and we get 1, and pressing it again we have 4.
6.2 More than one program in the memory.
If we want to have more than one program in the memory we can use more than one program space.
To create another program space just press ▀ GTO ..
The ▀ GTO command can be used in two different situations:
i) You are not in the programming mode.
-In this case you can use ▀ GTO .. to create another empty program space, but this happens only
if the current mode is not already empty.
-You can use ▀ GTO "label". (We will see this below)
-You can also use ▀ GTO followed by "END" or ".END." etc to move among program spaces.
(In this case I must admit 33S is better because the lack of this complication)
-And after chosen a program space you can use ▀ GTO ._ _ _ _ where in the "_"'s you put the
number of the line you want to go.
ii) You are in programming mode.
-In this case you cannot change the program space.
-You can use ▀ GTO ._ _ _ _ to move to a line. (This will happen and it is not programmed)
-You can use ▀ GTO "label" (This will be programmed and will make the program to jump to
that label)
But what is a label? A label is a name we give to a position in the program using the LBL command
which is available in ▀ PGN.FCN (it means "program functions") menu.
To create a label you must be in the programing mode (▀ PRGM) and then just press LBL and then
enter a name (1 to 7 letters). If you use only one letter you are not going to have the "" and the label
won't appear automatically when you press XEQ which is good for local labels.
(Just for comparison, in 33S the label is just one letter)
Example: In the programing mode ▀ PGN.FCN LBL A A A creates a label "AAA" which appears
as LBL "AAA" in program. So when the program is running and it found GTO "AAA", for
example, it will jump to the line which has LBL "AAA" instructions.
(Please note we don't need to press ▀ ALPHA to access the A, B, C, etc in this case)
Example of a program
01 LBL "AA"
02 GTO "AA"
03 .END.
(you don't enter this)
This program does nothing. It just run until you press EXIT. By the way, to run it you can use R/S
when the calculator's "pointer" is over the program or you can use XEQ "label". In the present case
you would use XEQ "AA".
The XEQ function calls a program (which must have a label) and runs it. You can use XEQ
function both in programing mode and also out of programing mode.

Advertisement

loading

This manual is also suitable for:

Free42