Xbasic

UI_GET_NUMBER_CALCULATOR Function

Syntax

Result_String as C = ui_get_number_calculator(C prompt [,C default_number ])

Arguments

Result_String

The calculated result as a series of numbers in a character string. Invalid entries, such as "abc" will return a NULL string. The Result_String will be empty if the user presses Cancel. The Result_String will be the original default value if the user presses either or the Escape key.

prompt

The title of the dialog box.

default_number

Optional. Default = "". The number that will appear in the calculator when the dialog is opened.

Description

UI_GET_NUMBER_CALCULATOR() prompts the user for a number by displaying a calculator in which the user can do calculations. When the user presses the = key, the calculation is performed, and the result is returned in Result_String. This function returns a character value. This function is useful in Xdialog dialog boxes. Use the VAL()function on the Result_String to get the number. Prompt for a number using a calculator.

images/ui_get_number_calculator.gif

You can enter any valid expression in the calculator. For example, you could enter: (23 + 34)/sqrt(234).

Example 

This script prompts the user for number.

ui_get_number_calculator("Amount to pay:","345.34")

Limitations

Desktop applications only.

See Also