Section 10: Programming with ALPHA Strings152
Another way to use the prompt is to use ARCL to recall a string from a register and then use PROMPT to halt program execution and display the prompt string. This method requires you to store the ALPHA string into a register for later use as a prompt string. You can either store this string before you execute the program or you can instruct the program to store the string. Refer to section 5 of part I for more information about ARCL .
Example: The following program prompts for a number, stops for the input, then computes the common logarithm of the number. The ALPHA prompt is a line in the program.
Keystrokes Display    
PRGM 
       
   
g GTO · · 
  00 REG 37    
   
g LBL 
       
   
ALPHA CLOG ALPHA 
  01 LBLTCLOG    
  The program name, CLOG.
ALPHA NUMBER? ALPHA 
  02TNUMBER?    
  The prompt string.
XEQ 
       
   
ALPHA PROMPT ALPHA 
  03 PROMPT    
  Displays the ALPHA string register and stops for data input.
LOG 
  04 LOG    
  The common logarithm.
g GTO · · 
  00 REG 34    
   
Find the log of 8 to see how the program works:
Keystrokes Display    
PRGM 
  0.0000    
  Takes the HP-41C out of PRGRM mode.
XEQ 
       
   
ALPHA CLOG ALPHA 
  NUMBER?    
  The prompt.
  8 _    
  The number.
R/S 
  0.9031    
  The log of 8.
g CLX 
  0.0000    
   
Prompting can also be accomplished using AVIEW (ALPHA view) and STOP in a program. The AVIEW displays the contents of the ALPHA register and the STOP halts program execution.
Labeling Data
Data labeling can be quite useful to the output your programs produce. Labeled output leaves no doubt as to which result is displayed. Data can be labeled with ALPHA strings using ASTO , ARCL and AVIEW . To label ouput: