Overview | Statement List


Choose多个选项

Synopsis

MCHOOS/primary string, menu options, response array[,ALTACT,'message',]response variable

Description

This statement creates a dialog box with a maximum of 14 options (15 options with the Alternate Action option). You may then interactively choose any or all of these options from the menu. Each option you choose causes a numerical value to be assigned to a variable, called the response array. You must choose OK to enter the chosen options into the response array.

CAUTION: We do not recommend using the asterisk character (*) in menu prompts or menu options.

The MCHOOS statement works with the Back, Cancel and the alternate action option. Back causes the value of 1 to be assigned to the response variable. Cancel causes 2 to be assigned. The value 3 indicates that zero or more menu options were chosen along with OK. The alternate action option causes 4 to be assigned to the response variable.

You can enable an alternate action option by using the minor word ALTACT, followed by a message, as the parameter just before the response variable. The ALTACT message displays as the last option in the dialog box. You can make the message up to forty characters long.

NOTE: To create a menu of options which allows you to only choose a single option, use the CHOOSE statement described earlier in this section.

The response array entries contain a 1 if the menu option that matches the entry's index is chosen, and a 0 otherwise. For example, if options 1 and 3 are chosen from a five option menu, the response array would contain 1,0,1,0,0.

Parameters

Parameter

Description

primary string

A string or string variable consisting of the title of the menu, which can be up to 40 characters.

menu options

A string list consisting of menu options. Each string can contain up to 40 characters, although the string display may be truncated on some terminal types.

NOTE: The string list may only contain 15 items (the menu title and 14 options).

response array

An array which handles the responses from the chosen options. You may use a subrange; however, it must be large enough to handle every menu option. The number of responses should match the number of menu options. The system returns a value of 1 if the corresponding option is chosen, a value of 0 if the option is not chosen.

ALTACT

Minor word that indicates that an alternate action message is to be created on the menu during statement execution. If the alternate action option is chosen, the response variable is equal to 4.

'message'

A string or string variable which represents the alternate action message. The string can contain up to forty characters.

response variable

A variable which is assigned a numerical value based on the user response.

 


Copyright ©2015 胡君NX二次开发官网(www.UGapi.com) QQ:85585969 All Rights Reserved.