COMBOBOX
Access properties of the Combo-box form control.
Partial WebVue support - See the table with the list of modes below. Not supported modes return an unsuccessful code if used in this context.
Mode |
Mnemonic |
Syntax |
Webvue support |
1 | COUNT | 1 | Yes |
2 | GETSELECTEDINDEX | 1 | Yes |
3 | SETSELECTEDINDEX | 2 | Yes |
4 | GETTEXT | 3 | Yes |
5 | GETUSERDATA | 3 | Yes |
6 | LOAD | 4 | Yes |
7 | INSERT | 5 | Yes |
8 | REMOVE | 6 | Yes |
9 | SORT | 7 | No |
10 | CLEAR | 1 | No |
11 | SETTEXT | No | |
12 | SETUSERDATA | 8 | No |
13 | SAVE | 4 | No |
Arguments common to more than one mode
Argument |
Meaning |
Window | The name of the window that contains the form control. Type STR. |
Branch | The branch (if any) of the window. Use "*" to indicate the current branch of the program. Type STR. |
Identity | The identity of the form control within the specified window. Type STR. |
Index | The index of an item. Type LONG. |
Syntax 1
LongVal = COMBOBOX(Mode, Window, Branch, Identity);
Return type: LONG.
Execution
Mode |
Mnemonic |
Action |
1 |
COUNT |
Returns the number of items. |
2 |
GETSELECTEDINDEX |
Returns the index of the item currently selected. |
10 | CLEAR | Clears the list contents and any selection. Return: 1 if successful. |
Return: 0 if unsuccessful. |
Syntax 2
LongVal = COMBOBOX(Mode, Window, Branch, Identity, Index[, Notify]);
Return type: LONG.
Argument |
Meaning |
Notify |
To indicate whether selection triggers the execution of the SCADA Basic function defined in the Operations configuration of the form control. Type INTEGER. |
Execution
Mode |
Mnemonic |
Action |
3 |
SETSELECTEDINDEX |
Select an item according to the value of the argument Index. If the Index is -1 then no item is selected. The function will scroll the control if necessary to display the item. Return: 1 if successful, else 0. |
Syntax 3
StrVal = COMBOBOX(Mode, Window, Branch, Identity, Index);
Return type: STR.
Execution
Mode |
Mnemonic |
Action |
4 |
GETTEXT |
Returns the Text of the item at Index as defined for the language currently in use. |
5 | GETUSERDATA | Returns the User Data associated with the item at Index. |
Syntax 4
LongVal = COMBOBOX(Mode, Window, Branch, Identity, FileName);
Return type: LONG.
Argument |
Meaning |
FileName |
The name of the file that contains the form control's data. |
Execution
Mode |
Mnemonic |
Action |
6 |
LOAD |
Loads the file's content into the form control's list of items. Return: 1 if successful (file loaded and form control populated), else 0. |
13 | SAVE |
Save the form control's list of items in a file. The form control's source must be set to File or the instruction will fail. Return: 1 if successful (items saved in file), else 0. |
Syntax 5
LongVal = COMBOBOX(Mode, Window, Branch, Identity, Text, Userdata, [Index]);
Return type: LONG.
Argument |
Meaning |
Text | The text to insert. Type STR. |
Userdata | The user data to insert. Type STR. |
Index | The index of an item in the form control. Type LONG. |
Execution
Mode |
Mnemonic |
Action |
7 |
INSERT |
Inserts a new item with the Text and optional Userdata in the form control list. If Index is omitted, the item is inserted at the end. Otherwise the item is inserted at the position indicated by Index, starting at 0 for the first item. |
Syntax 6
LongVal = COMBOBOX(Mode, Window, Branch, Identity, Index);
Return type: LONG.
Execution
Mode |
Mnemonic |
Action |
8 |
REMOVE |
Removes the item at Index from the form control. |
Syntax 7
LongVal = COMBOBOX(Mode, Window, Branch, Identity[, Sortorder, Orderby]);
Return type: LONG.
Argument |
Meaning |
Sortorder | A flag indication the sort order. 0 = ascending, 1 = descending |
Orderby | A flag selecting which data to sort by. 0 = Text, 1 = User data. |
Execution
Mode |
Mnemonic |
Action |
9 |
SORT |
Sort the form control list using the specified criteria. |
Syntax 8
LongVal = COMBOBOX(Mode, Window, Branch, Identity[, Index, StrVal]);
Return type: LONG.
Argument |
Meaning |
StrVal | The string value to set. |
Execution
Mode |
Mnemonic |
Action |
11 | SETTEXT | Sets the text of the item at Index with value StrVal. |
12 | SETUSERDATA | Sets the user data associated to the item at Index with value StrVal. |
Return: 1 if successful, else 0. |
Example
For an example, select the Example link above.