Reference Guide

RPL Programming 1-47
Program: Comments:
"ADD A NAME"
{
{ "NAME:" "ENTER NAME" 2 }
{ "PHONE:" "ENTER A PHONE
NUMBER" 2 } }
{ } { } { } INFORM
REPEAT
Creates an input form that gets
the name and phone number.
The two fields accept only
strings (object type 2).
DUP
IF { NOVAL } HEAD POS
THEN
Checks if either field in the
new entry is blank.
DROP
"Complete both fields
before pressing OK"
MSGBOX
If either one is, displays a
message.
ELSE 1
→LIST NAMES + SORT
'NAMES' STO
If neither are, adds the list to
NAMES, sorts it, and stores it
back in NAMES.
END
END
END
Ends the IF structure, the
WHILE loop, and the CASE
statement.
c 2 ==
Case 2 (View a Number).
THEN
IF { } NAMES SAME
THEN
Checks if NAMES is an empty
list.
"YOU MUST ADD A NAME FIRST"
MSGBOX
If it is, displays a message.
ELSE
WHILE
"VIEW A NUMBER"
NAMES 1 CHOOSE
If NAMES isn’t empty, creates
a choose box using NAMES as
choice items.
REPEAT
STR MSGBOX
When OK is pressed, the
second item in the NAMES
list pairs (the phone number) is
returned. Makes it a string and
displays it.
END
END
END
Ends the WHILE loop, the IF
structure, and the CASE
statement.
END
»
END
»
Ends the CASE structure,
marks the end of the local
variable defining procedure,
ends the WHILE loop, and
marks the end the program.
`O
PHONES
Stores the program in
PHONES.