Adds a Combo Box to the current dialog, where the field is mapped to a program variable.
Informal Syntax:
DialogAddComboBox( Prompt, Options, Target )
Formal Syntax:
DialogAddComboBox( Prompt:=Expression, Options:=Expression, Target:=Variable Reference )
Parameter | Type | Description |
---|---|---|
Prompt | ANY_STRING | The prompt string associated with the text entry field. |
Options | DINT | The identifier of a LinkedList Data Object to provide the options in the combo box. |
Target | REF_TO ANY_ELEMENTARY |
A reference to a program variable:
|
None.
How the Combo Box is initialized depends on the type of variable referenced by the Target parameter:
The value written to the Target parameter when the OK button is pressed depends on the type of variable:
VAR ListId : DINT; NewState : INT; DialogResult : INT; END_VAR (* Create a linked list storing the options *) ListId := LinkedListCreate(); LinkedListAddLast( ListId, 'Close' ); LinkedListAddLast( ListId, 'Open' ); DialogNew(); DialogAddComboBox( "New State", ListId, NewState ); DialogResult := DialogOpen( "Set new state", 1 ); IF DialogResult = 1 THEN (* Add code here to do something with NewState *) END_IF
To learn where you can use this function.
For the meaning of terms used in Fernhill SCADA.