RATS 11.1
RATS 11.1

Instructions /

MENU and CHOICE instructions

Home Page

← Previous Next →

MENU   "menu description string"

CHOICE "choice identifier string"

instruction block for this choice

other CHOICE instructions

END MENU

 

MENU and CHOICE help you control a menu- and dialog-driven procedure. They present to the user a dialog box with mutually exclusive choices. MENU and CHOICE are useful when you need the user to select one of a (small) set of choices for an operation, or make a single choice of action. However, the USERMENU instruction is preferable for setting up the main control of your procedure; SELECT is useful when the list of choices is long or variable, or where the user can select more than one item; and DBOX offers greater flexibility.

Parameters

menu description string

either a string of text enclosed in single quotes, or a STRING variable

choice string

text displayed to identify the choice

Description

A menu block consists of:

 

1.a MENU instruction

2.two or more CHOICE instructions, each followed by the instruction or block of instructions to be executed if the user makes that choice.

3.an END MENU to terminate.

Example

menu "Which Transformation Do You Want?"

choice  "Log"

   set series = log(series)

choice  "Square Root"

   set series = sqrt(series)

choice  "Percent Change"

   set(scratch) series = log(series/series{1})

choice  "None"

    ;

end menu

 


Copyright © 2026 Thomas A. Doan