Difference between revisions of "AskMsgNumber"
Line 2: | Line 2: | ||
[[Category:Doc Status C]] <!-- For Lumina use, do not change --> | [[Category:Doc Status C]] <!-- For Lumina use, do not change --> | ||
− | |||
− | + | == AskMsgNumber(question,''text,default'') == | |
− | + | [[Syntax]]: | |
− | = AskMsgNumber(question,''text,default'') = | + | :[[AskMsgNumber]](question : Text; title : optional text; default : optional numeric) |
− | |||
− | |||
Shows a message box with specified title, question and a textbox containing the default value, if any. It returns the number entered by the user into the text box. | Shows a message box with specified title, question and a textbox containing the default value, if any. It returns the number entered by the user into the text box. | ||
Line 14: | Line 11: | ||
If the default is specified, it is displayed using the number format for the object containing the call. When not specified, the entry box will be blank initially. By setting the number format for the variable containing the call to date, a date entry is accepted. | If the default is specified, it is displayed using the number format for the object containing the call. When not specified, the entry box will be blank initially. By setting the number format for the variable containing the call to date, a date entry is accepted. | ||
− | The | + | The '''OK''' button is active only when a valid number has been entered. The '''Cancel''' button aborts the current computation. |
− | |||
− | |||
− | + | 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. | |
− | + | == Example == | |
+ | :<code>AskMsgNumber("Please enter an approximate estimate of the internal rate of return", default: 15%)</code> | ||
− | + | :[[image:AskMsgNumberDialog.jpg]] | |
+ | == See Also == | ||
* [[AskMsgText]] | * [[AskMsgText]] | ||
* [[AskMsgChoice]] | * [[AskMsgChoice]] | ||
* [[MsgBox]] | * [[MsgBox]] | ||
+ | * [[Creating Interfaces for End Users]] |
Revision as of 19:53, 20 January 2016
AskMsgNumber(question,text,default)
- AskMsgNumber(question : Text; title : optional text; default : optional numeric)
Shows a message box with specified title, question and a textbox containing the default value, if any. It returns the number entered by the user into the text box.
If the default is specified, it is displayed using the number format for the object containing the call. When not specified, the entry box will be blank initially. By setting the number format for the variable containing the call to date, a date entry is accepted.
The OK button is active only when a valid number has been entered. The Cancel button aborts the current computation.
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.
Example
AskMsgNumber("Please enter an approximate estimate of the internal rate of return", default: 15%)
Enable comment auto-refresher