Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

FormCheckBox

  • Last UpdatedJul 18, 2023
  • 2 minute read

Adds a check box to the current form. The check box is a form control that allows the operator to make individual selections. Each check box can be either checked (true) or cleared (false).

You should call this function only after the FormNew() function and before the FormRead() function. The check box is added to the form at the specified column and row position. The width of the button is automatically sized to suit the text.

Syntax

FormCheckBox(Col, Row, sText, sBuf)

Col:

The number of the column in which the check box will be placed. Enter a number from 0 (column 1) to the form width - 1. For example, to place the check box in column 8, enter 7.

Row:

The number of the row in which the check box will be placed. Enter a number from 0 (row 1) to the form height - 1. For example, to place the check box in row 6, enter 5.

sText:

The text associated with the check box.

sBuf:

The string buffer in which to put the state of the check box. You should initialize this buffer to the state of the check box. When the form returns, this buffer will contain either '1' or '0' if the box is checked.

Return Value

The field handle if the check box is successfully added, otherwise -1 is returned.

FormNew, FormRead

Example

! Create a form, add check boxes, and display the form.

! The operator may select none or all of the check boxes.

FUNCTION FnMenu()

STRING sNuts, sCherrys, sChocolate;

sNuts = "1";

sCherrys = "0";

sChocolate = "1";

FormNew("IceCream",20,6,1); ]

FormCheckBox(2 ,2,"Nuts", sNuts);

FormCheckBox(2, 3,"Cherrys", sCherrys);

FormCheckBox(2 ,4,"Chocolate", sChocolate);

FormRead(0);

If sNuts = "1" THEN

! add the nuts

END

IF sCherrys = "1" THEN

! add the cherrys

END

IF sChocolate = "1" THEN

! add the chocolate

END

END

See Also

Form Functions

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in