*Option()
Creates an option menu.
Syntax
*Option(option_name,"option_label",n,"option_1", "option_2",, "option_n", [ival_1,ival_2,,ival_n], [strval_1,strval_2,,strval_n], edit_option)Arguments
- option_name
- The variable name of the option menu.
- option_label
- The descriptive label of the option menu.
- n
- The number of items in the option menu.
- option_1, option_2,..., option_n
- Labels for the option menu items.
- ival_1, ival_2, ..., ival_n
- Optional integer values associated with the items in the option menu.
- strval_1, strval_2, ..., strval_n
- Optional string values associated with the items in the option menu.
- edit_option
- A keyword which specifies whether or not this data member entity is editable in the MotionView graphical user interface. Valid values are: EDIT or NO_EDIT
- varname
- The variable name of the option menu.
Example
*DefineDataSet(dsdef_vehpar)
 *Option(model, "Model", 5, "Small", 
 "Mid-size", 
 "Luxury", 
 "Sport Utility", 
 "Truck", 
 EDIT)
 *Integer(wheelbase, "Wheelbase")
 *Real(spr_mass_cg_hgt, "Sprung Mass CG Height")
 *Real(frnt_spr_mass, "Front Sprung Mass")
 *Real(rear_spr_mass, "Rear Sprung Mass")
*EndDefine()Context
Properties
| Property | Returns Data Type | Description | 
|---|---|---|
| current_index | integer | Index of the currently selected item. | 
| ival | integer | The integer value associated with the currently selected item. | 
| label | string | The descriptive label of the option menu. | 
| state | boolean | Control state (TRUE or FALSE). | 
| strval | string | The string value associated with the currently selected item. | 
| value | string | The label of the currently selected item. | 
| varname | string | The variable name of the option menu. | 
Comments
The optional values ival and strval do not appear in an option list. They are for use by other MDL statements. Selecting a particular item makes the associated ival and strval the current ival and strval. For example, if the second item of opt_name were selected, opt_name.ival and opt_name.strval would be assigned the value of ival_2 and strval_2.
The arguments in an *Option() statement specify the option menu items. The current selection from the option menu is specified by a *SetOption() statement. Unless otherwise specified, the first item of an option menu is set as the current selection.