This example demonstrates the use of the PARAM statement to create a user-defined menu.
L0:
PARAM/'ADD ON INT. VALUES',$
'PRINCIPLE',PRINC,$
'RATE OF %',RATE,$
'MONTHS',INT,MONTHS,RSP
JUMP/L0:,L1:,,RSP
$$ CALCULATE TOTAL OBLIGATION
AMT=(PRINC*RATE*MONTHS)/12
$$ CALCULATE MONTHLY PAYMENT
PYMNT=AMT/MONTHS
$$ OUTPUT RESULTS
PRINT/'TOTAL OBLIGATION = ',AMT
PRINT/'MONTHLY PAYMENT = ',PYMNT
JUMP/L0:
L1:
HALT
The previous program segment would display the following cue line and dialog box:
Cue Line and Dialog Box
NOTE:
Option number 3 in the menu above does not have a decimal point
because the minor word INT was programmed before the variable
MONTHS in the PARAM statement. This does not affect the
results as all numerical variables in GRIP are treated as real numbers.