You can specify a help message and the type of data that must be entered in field by entering field specifications as lists. For example, { { "Name:" "Enter your name" 2 } } defines the Name field, displays Enter your name across the bottom of the input form, and accepts only object type 2 (strings) as input.

To set up a choose box:

1.Enter a title string for the choose box.

2.Enter a list of items. If this is a list of two-element lists, the first element is displayed in the choose box, and the second element is returned to level 2 when OK is pressed.

3.Enter a position number for the default highlighted item. (0 makes a view-only choose box.)

4.Execute the CHOOSE command.

Example: Enter a title "FIRST ONE" `.

Enter a list of items { ONE TWO THREE } `.

Enter a position number for default highlighted value 3 `.

Execute CHOOSE (!°L%IN%%CHOOS%).

Example: The following choose box appears:

Example: The following program uses input forms, choose boxes, and message boxes to create a simple phone list database.

Program:

Comments:

 

 

«

 

'NAMES' VTYPE

Checks if the name list

IF -1 ==

(NAMES) exists, if not, creates

THEN { } 'NAMES' STO

an empty one.

END

 

WHILE

While cancel is not pressed,

"PHONELIST OPTIONS:"

creates a choose box that lists

{

the database options. When

{ "ADD A NAME" 1 }

OK is pressed, the second

{ "VIEW A NUMBER" 2 }

item in the list pair is returned

} 1 CHOOSE

to the stack.

 

REPEAT → c «

Stores the returned value in c.

CASE c 1 ==

Case 1 (ADD name), while

THEN

cancel is not pressed, do the

WHILE

following:

 

 

1-46 RPL Programming