DialogAddComboBox Function

Help Contents


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 )


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:
  • The field is initialized with the value of the program variable when the dialog is opened.
  • The value of the field is written to the program variable when the OK button is pressed.

Return Value



How the field 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:


  1. Use DialogAddComboBox to add a combo box field with two options to a dialog:
    VAR ListId : DINT; NewState : INT; DialogResult : INT; END_VAR
    (* Create a linked list storing the options *)
    ListId := LinkedListCreate();
    LinkedListAddLast( ListId, 'Close' );
    LinkedListAddLast( ListId, 'Open' );
    DialogAddComboBox( "New State", ListId, NewState );
    DialogResult := DialogOpen( "Set new state", 1 );
    IF DialogResult = 1 THEN
        (* Add code here to do something with NewState *)

Further Information

Operator Actions

To learn where you can use this function.


For the meaning of terms used in Fernhill SCADA.