|
|
|
Programming with ALPHA Strings
|
|
One of the greatest utilizations of the HP-41C ALPHA capability is
in programs that you write. ALPHA strings (a series of ALPHA
characters) in your programs can prompt you for information, inform
you of the status of a program and even label output. This section
shows you how to use ALPHA strings in your programs.
|
|
Using ALPHA Strings in Your Programs
|
|
You can use ALPHA string in many different ways in your programs, and there
are certain ways that these strings change what you see in the display
while a program is running.
|
|
For example, you can place an ALPHA string in a program and instruct
the program to display that string with AVIEW .
The ALPHA string that you input as a line in the program is placed into
the ALPHA register. AVIEW then places the contents
of the ALPHA register into the display. As program execution progresses,
the display continues to display the string until the program clears the
string from the display, or you place a new string into the display.
|
|
Any time a program places an ALPHA string into the display, that
string replaces the program
execution symbol. When the program clears the display or the program
is interrupted, the returns
to the display. Regardless of what is displayed, the
PRGM annunciator is always displayed
during a running program.
|
|
The maximum length of an ALPHA string on any one line in a program is 15
characters. However, using APPEND (
g
K in ALPHA mode), you can construct
strings of up to 24 characters. Key in the first 15 characters in the
string, press APPEND and then key in the
remainder of the characters. The first 15 characters will be on one line
in the program, and the remainder of the characters will be on the
following line. Refer to
section 3
in part I for more information about
APPEND .
|
|
Prompting
|
|
There are several ways to use ALPHA strings in your programs to prompt
for data input. Prompts in your programs are a simple way to assure that you
input the correct data value. Or you can use prompts to simply display
messages.
|
|
The easiest way to use prompts is with the PROMPT
function. The PROMPT instruction in a program
displays the contents of the ALPHA register and stops program
execution. Simply key in the ALPHA string as a line in the program and
follow it with PROMPT . Execution will halt
and the display will show the prompt string.
|