ConfirmActionDialog Function

Help Contents

Introduction

Opens a dialog with a title, message and OK and Cancel buttons.

Syntax

Informal Syntax:

ConfirmActionDialog( Title, Message )

Formal Syntax:

ConfirmActionDialog( Title:=Expression, Message:=Expression )

Parameters

ParameterTypeDescription
Title ANY_STRING The title that appears at the top of the dialog.
Message ANY_STRING The message to display in the dialog.

Return Value

An INT value indicating which button was pressed:

ValueButton
0Cancel
1OK

Remarks

The ConfirmActionDialog() function is logically equivalent to:

FUNCTION ConfirmActionDialog : INT
VAR_INPUT
    Title : WSTRING;
    Message : WSTRING;
END_VAR

    DialogNew();
    DialogAddLabel( Message );
    ConfirmActionDialog := DialogOpen( Title, 1 );
END_FUNCTION

Examples

  1. Use the ConfirmActionDialog() function to ask the operator whether they wish to proceed:
    VAR Result : INT; END_VAR
    
    Result := ConfirmActionDialog(
            "Confirm Shutdown", 
            "Please confirm you want to halt the current process?");
    
    IF Result = 1  THEN
        (* Statements executed in the user presses the OK button *)
    END_IF

    The above code would display the following dialog:

    Confirm Action Dialog

Further Information

DialogNew

To learn about the DialogNew() function.

DialogAddLabel

To learn about the DialogAddLabel() function.

DialogOpen

To learn about the DialogOpen() function.

Operator Actions

To learn where you can use this function.

Glossary

For the meaning of terms used in Fernhill SCADA.