Ask Password Command
ask password <question> [with <reply>]
[at <x,y>] Applies to global
The ask password command behaves much like the ask command, but goes one step further. Instead of entering the user's typed reply into the local variable it, ask password translates the reply into a number and stores it in encrypted form.
You can use this command to maintain the confidentiality of your data, prevent damage, and protect against modification of your stacks. For example, Oracle Media Objects can store the user's typed reply in a field and compare it with the valid passwords that you have previously created.
To use the ask password command, you must first determine the encrypted form of the password you want to use. This can be done by putting the following script in a button:
ask password "Please enter desired password" put "The encrypted form is" && it into msg
Now go back to Browse mode and click on the button. At the prompt, enter "test" as the password and click on the OK button. The encrypted form appears in the Message Box:
The encrypted form is 1017032090
Now you can use this code in a script to protect sensitive information, such as salaries in an employee stack. Make a field called "Salary" and enter a value. Then type this in the Message Box and press Enter:
hide field "Salary"
Now you can make a button called "Show Salary", and set it up so that the user can only see the field if he or she knows that the password is "test." Create this button script:
ask password "Please enter password" if it is -362801982 then
show field "Salary" else
answer "Incorrect Password" end if
This text has been mechanically extracted from the Oracle Media Objects 184.108.40.206 MediaTalk Reference, © 1995 Oracle Corporation, and is provided here solely for educational/historical purposes.