supergetpassword
supergetpassword
INPUTTEXT
,
OPTIONS

The supergetpassword statement will display a dialog with a text entry area for a password.

Parameters

This statement has two parameters:

inputtext – Field or variable where user’s input will be placed.

options – This parameter may contain one or more options that alter the operation of the dialog. See the description below for more information.

Description

This statement displays a dialog with a text entry area for entering a password. You can control the size of the dialog, as well as several appearance options. If the dialog has more than one button, info(“dialogtrigger”) will contain the name of the button that was pressed. Here is an example showing how this statement can be used:

    local thePassword
    thePassword = ""
    supergetpassword thePassword,{buttons="Unlock;Cancel"}
    if info("dialogtrigger") contains "cancel" rtn endif
    if thePassword = "bigsecret"
       // do something secret here!
    endif

Most of the options for this statement are the same as the SuperGetText statement – see the documentation on that statement for details.

#### Remember Password Option

If the options include `remember=yes` the operation of this dialog is a bit different. In addition to the text field for the password, there is also a checkbox that asks if you want to remember the password. When the dialog is finished, the password variable contains a dictionary instead of just a text value. This dictionary contains two items: `PASSWORD` - the password the user typed in, and `REMEMBER`, which will contain an `x` if the checkbox was checked, or blank if it was not checked.

Here is an example that uses this option. If the user enters the correct password and checks the checkbox, they won’t be prompted for the password again the next time this code runs. In fact they won’t ever be prompted again as long as this database is open.

    fileglobal rememberPassword
    define rememberPassword,""
    if rememberPassword=""
        local thePassword
        thePassword = ""
        supergetpassword thePassword,{remember=yes}
        if info("dialogtrigger") contains "cancel" rtn endif
        if getdictionaryvalue(thePassword,"PASSWORD") <> "bigsecret" rtn endif
        rememberPassword = getdictionaryvalue(thePassword,"REMEMBER")
    endif
    // do something secret here

See Also

- dialogs --

History

Version | Status | Notes
10.0 | No Change | Carried over from Panorama 6.0.