HP 3000 Manuals

The Calculator [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation


HP Business BASIC/XL Reference Manual

The Calculator 

The HP Business BASIC/XL interpreter can be used as a calculator.  If you
type in a numeric expression without a line number, HP Business BASIC/XL
will return the value of that expression.  Table 2-12 summarizes the what
happens with each response to the interpreter prompt.  Note that at the
end of each line, you can type either RETURN or CONTROL E.

          Table 2-12.  The Calculator 

-----------------------------------------------------------------------------------------------
|                                    |                   |                                    |
|         In Response to the         |    Then press:    |               Effect               |
|   Interpreter Prompt (>), Type:    |                   |                                    |
|                                    |                   |                                    |
-----------------------------------------------------------------------------------------------
|                                    |                   |                                    |
| Expression (except a numeric       |      RETURN       | HP Business BASIC/XL displays the  |
| literal)                           |                   | value of the expression.           |
|                                    |                   |                                    |
-----------------------------------------------------------------------------------------------
|                                    |                   |                                    |
| num_lit                            |      RETURN       | HP Business BASIC/XL deletes the   |
|                                    |                   | program line that is numbered      |
|                                    |                   | num_lit.                           |
|                                    |                   |                                    |
-----------------------------------------------------------------------------------------------
|                                    |                   |                                    |
| Program line                       |      RETURN       | HP Business BASIC/XL adds the      |
|                                    |                   | program line to the program.       |
|                                    |                   |                                    |
-----------------------------------------------------------------------------------------------
|                                    |                   |                                    |
| Anything else                      |      RETURN       | RETURN is treated as CONTROL E     |
|                                    |                   |                                    |
-----------------------------------------------------------------------------------------------
|                                    |                   |                                    |
| Anything                           |     CONTROL E     | HP Business BASIC/XL executes the  |
|                                    |                   | statement that would result from   |
|                                    |                   | putting "DISP" before what was     |
|                                    |                   | typed.                             |
|                                    |                   |                                    |
-----------------------------------------------------------------------------------------------
|                                    |                   |                                    |
| Nothing                            |     CONTROL E     | HP Business BASIC/XL executes the  |
|                                    |                   | STEP command.  Refer to "Debugging |
|                                    |                   | a Program" earlier in this chapter |
|                                    |                   | for more information.              |
|                                    |                   |                                    |
-----------------------------------------------------------------------------------------------

Example 

     >2+2 RETURN               (numeric expression)
     4
     >(5*(27/3)) RETURN        (numeric expression)
     45
     >Index1=12 RETURN         (assignment)
     12
     >Index2=3 RETURN          (assignment)
     3
     >Index1*Index2 RETURN     (numeric expression)
     36
     >10 PRINT RETURN          (program line)
     >10                       (line number with nothing else deletes line)
     >Index1*Index2 RETURN     (numeric expression)
     36
     >Index1=12 RETURN         (assignment)
     12
     >Index2=Index1 RETURN     (assignment)
     12
     >10 PRNIT RETURN          (syntax error)
     Error



MPE/iX 5.0 Documentation