AskMsgText
AskMsgText(question, title, maxText, default, password, checkboxText, initialCheck)
Show a message box with «title», «question» and a textbox containing the «default» text, if any. It returns the text entered by the user into the text box, or the default if none.
Example
AskMsgText("Enter your model access key", title: "License Entry", maxText: 15)
- AskMsgText(question: Text; title: optional text; maxText: optional positive; default: optional text; password: optional boolean, checkboxText: optional text; initialCheck: optional boolean)
Optional parameters
«maxText»L If specified, it will not accept more than this number of characters.
«checkboxText»: If specified, it shows this text with a checkbox. (New to Analytica 5.4) You can optionally include a checkbox question at the bottom by specifying «checkboxText». Specify whether it is checked initially by setting «initialCheck» to True or False. When «initialCheck» is unspecified, it defaults to off (False). When you specify «checkboxText», it returns two return values, where the second return value is the boolean state of the checkbox. To capture this, use for example
Local (enteredText, checked) := AskMsgText("Enter the plant name", checkboxText:"Is a co-generation facility");
«initialCheck»: Initial state (true or false) of checkbox.
The message box appears only when this function is evaluated. Since Analytica caches results once they are computed, if you embed this in a variable, you will not see the question every time you view the result. To trigger the question again, you must change something upstream that the variable depends on, so the result is invalidated. If you place it inside a button script, you would see it every time the button is pressed.
When «password» is true, obscures the characters typed, showing asterisks rather than the typed characters.
The box displays OK and Cancel buttons. Pressing Cancel causes the current computation to abort.
From ADE
When evaluated in the Analytica Decision Engine (ADE), it calls IAdeUICallbacks::AskMsgText(...). From within that callback, the parent application can display a dialog, collect input from the end-user, and return that as the return value. To receive the callback, the parent application must have previously registered the callback with ADE using CAEngine::SetCallbackObject( ). If it has not registered a callback, then «default» is returned.
Enable comment auto-refresher