CHECKLIST
Access properties of the Check-box list 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 | 4 | Yes |
5 | GETUSERDATA | 4 | Yes |
6 | GETSTATE | 7 | Yes |
7 | SETSTATE | 3 | Yes |
8 | LOAD | 5 |
Yes |
9 | GETEVENTTYPE | 1 | Yes |
10 | INSERT | 6 | Yes |
11 | REMOVE | 7 | Yes |
12 | SORT | 8 | No |
13 | CLEAR | 1 | No |
14 | SETTEXT | 9 | No |
15 | SETUSERDATA | 9 | No |
16 | SAVE | 5 | No |
An important note about the terminology used and operation of the Check List control in PcVue.
-
An item that is SET is one in which the center of the corresponding square is ticked.
-
The item that is SELECTED is the one whose text is highlighted (by changing its background color)
An item that is SET is not necessarily SELECTED (and vice versa). Programmatically you are normally only interested in which items are SET. The item that is SELECTED has little meaning.
For more information on the behavior of the Check List control, see PcVue main help.
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 in the specified window. Type STR. |
Index |
The index of the item to select. Type LONG. |
Notify |
To indicate whether the action triggers the execution of the SCADA Basic function defined in the Operations configuration of the form control. Type INTEGER. |
Syntax 1
LongVal = CHECKLIST(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. |
9 | GETEVENTTYPE |
Returns the type of the most recent event. The return is binary weighted value. |
13 | CLEAR |
Clears the list contents and any selection. Return: 1 if successful |
Return: 0 if unsuccessful. |
Syntax 2
LongVal = CHECKLIST(Mode, Window, Branch, Identity, Index[, Notify]);
Return type: LONG.
Execution
Mode |
Mnemonic |
Action |
3 |
SETSELECTEDINDEX |
Select an item according to the value of the argument its 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
LongVal = CHECKLIST(Mode, Window, Branch, Identity, Index, State[, Notify]);
Return type: LONG.
Argument |
Meaning |
State | State to be set. The value can be 0 or 1. Type INTEGER |
Execution
Mode |
Mnemonic |
Action |
7 | SETSTATE |
Sets the state of the item corresponding to the supplied index. The function will scroll the control if necessary to display the item. Return: 1 if successful, else 0. |
Syntax 4
StrVal = CHECKLIST(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 5
LongVal = CHECKLIST(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 |
8 |
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. |
16 | 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 6
LongVal = CHECKLIST(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 |
10 |
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 7
LongVal = CHECKLIST(Mode, Window, Branch, Identity, Index);
Return type: LONG.
Execution
Mode |
Mnemonic |
Action |
6 | GETSTATE | Returns the state of the item (ticked or not). |
11 |
REMOVE |
Removes the item at Indexfrom the form control. |
Syntax 8
LongVal = CHECKLIST(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 indicating the sorting criteria. 0 = Text field, 1 = User data field. |
Execution
Mode |
Mnemonic |
Action |
12 |
SORT |
Sort the form control list using the specified criteria. |
Syntax 9
LongVal = CHECKLIST(Mode, Window, Branch, Identity[, Index, StrVal]);
Return type: LONG.
Argument |
Meaning |
StrVal | The string value to set. |
Execution
Mode |
Mnemonic |
Action |
14 | SETTEXT | Sets the text of the item at Index with value StrVal. |
15 | 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.