Difference between revisions of "AskMsgText"
Davidpaine (talk | contribs) |
|||
Line 2: | Line 2: | ||
[[Category:Doc Status C]] <!-- For Lumina use, do not change --> | [[Category:Doc Status C]] <!-- For Lumina use, do not change --> | ||
− | |||
− | [[ | + | == AskMsgText(question, ''title, maxText, default, password'') == |
+ | [[Syntax]] | ||
+ | :[[AskMsgText]](question: Text; title: optional text; maxText: optional positive; default: optional text; password: optional boolean) | ||
− | + | Shows a message box with specified «title», «question» and a textbox containing the «default» text, if any, and allowing up to «maxText» characters (or up to the number of characters in default, if that is greater). It returns the text entered by the user into the text box, or the default if none. | |
− | + | 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 | + | The box displays '''OK''' and '''Cancel''' buttons. Pressing '''Cancel''' causes the current computation to abort. |
− | + | == Example == | |
+ | :<code>AskMsgText("Enter your model access key", title: "License Entry", maxText: 15)</code> | ||
− | + | :[[image:AskMsgTextDialog.jpg]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | == See Also == | ||
* [[MsgBox]] | * [[MsgBox]] | ||
* [[AskMsgNumber]] | * [[AskMsgNumber]] | ||
* [[AskMsgChoice]] | * [[AskMsgChoice]] | ||
+ | * [[Creating Interfaces for End Users]] |
Revision as of 19:18, 20 January 2016
AskMsgText(question, title, maxText, default, password)
- AskMsgText(question: Text; title: optional text; maxText: optional positive; default: optional text; password: optional boolean)
Shows a message box with specified «title», «question» and a textbox containing the «default» text, if any, and allowing up to «maxText» characters (or up to the number of characters in default, if that is greater). It returns the text entered by the user into the text box, or the default if none.
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.
Example
AskMsgText("Enter your model access key", title: "License Entry", maxText: 15)
Enable comment auto-refresher