<< Click to Display Table of Contents >> Navigation: 3. Script Language > Input- and Output commands > Input and Output Commands |
MiniRobotLanguage (MRL)
GUP. Command
Get User Password
Intention
Get an input text/password from the user. The difference to GUT is, that a password-textbox is used. When the user types, it looks like this:
Usage is easy:
GUP.
will show a dialog like this:
The cursor will blink, and the dialog will immediately take user input. The user can type up to 260 characters into the textbox. The result, will be place on TOS. You can try it using this sample script:
GUP.
STS.DUMP
MBX.Ready?
ENR.
Next you may want to change the Dialog-text and the dialog Headline.
These are parameters P2 and P3:
GUP.Please type your serial.|Serial question!
You may want to add a "default text". Like the one you can see in the picture below.
GUP.Please type your serial.|Serial question!|email@email.com
And finally you can have the result in the variable, P4.
Here is a complete Sample:
' Get User Text
: $$TXT=Please enter your mailadress.
: $$HEA=
: $$DEF=yourmail@yourdomain.com
GUP.$$TXT|$$HEA|$$DEF|$$RES
' Remove Invalid characters
GFS.e|$$RES
' Display result
MBX.Your Mailadress is:$crlf$$$RES
ENR.
Syntax
GUP.[P1][|P2][|P3][|P4]
Parameter Explanation
P1 - (optional) Text/Explanation to the user. If omitted, the phrase
"Please Enter the required data:" is used. If you really want to have no text,
use a blank, like this
' complete empty input-box
GUP. | |
P2 - (optional) Text, window title. If omitted the phrase "User Input required!" is used.
If you really want to have no text, use a blank, like this
GUP. |Serial question!
P3 - (optional) Text, default Text for the textbox. If omitted no default text is given.
P4 - (optional) Variable that will receive the user-text. If omitted, user-input
is placed on TOS.
Example
'*****************************************************
' GUT. / GUP. - Sample
'*****************************************************
' Get User Mailadress
: $$TXT=Please enter your mailadress.
: $$HEA=
: $$DEF=yourmail@yourdomain.com
GUT.$$TXT|$$HEA|$$DEF|$$MAI
' Remove Invalid characters
GFS.e|$$MAI
:again
' Get User Password
: $$TXT=Please enter your password.
: $$HEA=You MUST enter something!
: $$DEF=
GUP.$$TXT|$$HEA|$$DEF|$$RES
' Trim Spaces away
VBT.$$RES
' Convert to small letters
VTL.$$RES
' Jump back if empty string is given
IVV.$$RES=
GTO.again
EIF.
' Display result
MBT.Your Mailadress is:$crlf$$$MAI$crlf$$crlf$Your password in small letters is:$crlf$$$RES
ENR.
'*****************************************************
Remarks
If you do want to have secret information to be typed in, use GUP. instead.
Limitations:
-
See also:
• DIP. - Delayed Instruction Processing
• DMP. - Dump internat Informations