ASK operator
The ASK operator creates an action that asks the user a question or requests confirmation in a dialog form.
Syntax
ASK expression
[HEADER headerExpression]
[[alias =] YESNO]
[DO actionOperator [ELSE elseOperator]]
Description
The ASK operator creates an action that requests confirmation or an answer to a question in a dialog form.
Parameters
-
expressionAn expression whose value is the question or message text. If the value is
NULL, the dialog is not shown and the input is considered completed successfully. IfYESNOis used, this is equivalent to a positive answer. -
headerExpressionAn expression whose value is used as the dialog header. If omitted, or if its value is
NULL, thelsFusionheader is used. -
YESNOA keyword whose presence changes the dialog behavior. By default, the dialog contains only buttons for positive and negative answers, and the negative answer is treated as input cancellation. If
YESNOis specified, the client also shows a separate cancellation button, while the positive and negative answers become successful input results: the positive answer givesTRUE, and the negative answer givesNULL. -
aliasThe name of the local logical parameter that stores the dialog result and is available only in
actionOperator. It can only be used together withYESNO. The positive answer is written asTRUE, the negative answer asNULL. Simple ID. If the dialog is canceled,actionOperatoris not executed. -
actionOperatorA context-dependent action operator that is executed if the input is completed successfully. Both the parameters of the created action and
alias(if specified) can be used as parameters. -
elseOperatorA context-dependent action operator that is executed if the input is cancelled. Only the parameters of the created action can be used as parameters.
Example
testAsk() {
ASK 'Are you sure you want to continue?' HEADER 'Confirmation' DO {
MESSAGE 'You continued';
}
ASK 'Use old values?' useOld = YESNO DO {
IF useOld THEN
MESSAGE 'Using old values';
ELSE
MESSAGE 'Using new values';
}
}