App.ValidateUser
The ValidateUser application function is used to check a user name and password. It returns a Boolean value (True or False), depending on whether the user name and password are correct.
Syntax |
App.ValidateUser ( Username, Password) |
Description |
When executed, the ValidateUser function compares a defined user name and password to a user account. If the user name and password are correct for for the user account, the ValidateUser function returns True. If the user name and password are invalid, the ValidateUser function returns False. |
Arguments |
User Name {string} The name of the user account.
Password {string} The password for the user account. |
Returns |
Returns a Boolean value. This is True if the user name and password match the user name and password of a user account. If the user name and password do not match a user account, ValidateUser returns False. |
This function is often used to confirm that a user is an authentic user before they can issue a control to a point. For example, a Mimic could be configured to have a button that, when selected, sets a point to have a value of 60. By using the ValidateUser function, the script creator can set the script so that it only writes the value of 60 if the user has entered a valid user name and password.
Example:
- If App.ValidateUser( "AYOUNG", "AY07AV" ) Then
- ' Do action, e.g. issue control
- Else
- MsgBox "Incorrect username or password specified.", vbOKOnly+vbExclamation, "Error"
- End If
NOTE: In this example, the ' Do action’ comment indicates the part of the script where you would define the action to be taken, such as issue a control to a point.