INPUTBOX()

From Lianjapedia
Jump to: navigation, search

Purpose

Function to display a dialog box with for user input of a string

Syntax

INPUTBOX(<expC1> [, <expC2> [, <expC3>]])

See Also

ETOS(), JavaScript built-in Lianja/VFP functions, MESSAGEBOX()

Description

The INPUTBOX()function is used to display a dialog box with OK and Cancel buttons allowing the user to input a string. The message, title and default value to display in the box can be defined. If the user clicks the OK button INPUTBOX() returns the input string. If the user clicks the Cancel button or pressed Esc, an empty string is returned.

Parameters Required Description
<expC1> Yes The prompt displayed in the dialog box
<expC2> No The title displayed in the dialog box
<expC3> No The default value displayed in the dialog box. If this is set to '*', any entered text is not echoed, so can be used for password entry.

Example

nReturn = inputbox("Please enter your password:", "System login", "*")
if not empty(nReturn)
    select users
    seek username()
    if password = nReturn
        // match
    else
        // nomatch
    endif
    // no password entered
endif