TUTORIAL 3: HP48 Programming principles
The aim of a program is to make life a bit easier
Essentially you want a result without all the hard yakka of number crunching.

A program takes in the minimum amount of information required performs computations and displays the result.

INPUT COMPUTE OUTPUT

The HP48 program

A program is a series of commands within << >> delimiters. A program is itself an object.

Inputting data

Single line input

"Prompt name"
""
INPUT OBJ\->

Multiple line input

"Input title"
{":Prompt 1:
:Prompt 2:
:Prompt 3:"
{ 1 0 } }
INPUT OBJ\->

Computation commands

Outputting results

"Output title" Value
+
CLLCD 1 DISP 3 FREEZE

An example of a simple program

Comments are after the @ character

<<
@ Program to reduce a slope distance to horizontal

@ Set HP 48 modes
DEG @ Ensures degrees mode is set

@ prompt for input

"SLOPE REDUCTION" @ Title of input / program
{":Zenith <) :
:Slope Dist:"
{ 1 0 } }
INPUT OBJ\->

@ Store input data as local variables

-> za sd
<<

@ Compute horizontal distance
za HMS\-> SIN sd *

@ Display result
3 FIX @ set decimal places to 3
"HD = " SWAP + " m"
CLLCD 1 DISP 3 FREEZE

>>
>>

Go to next tutorial

Return to
Tutorial page| Programming tips| Quickclose Homepage|

QUICKCLOSE
ABN 68 801 812 834
PO Box 1035 LEICHHARDT NSW 2040 AUSTRALIA
Tel/Fax +61 +2 9550 0010
EMAIL : quickclose@quickclose.com.au

Created with EditPad
Last Update: 18th March 2001
Richard Stanaway