There was nothing in the request about validating the keys entered... So
even if a backspace is pressed, throw the *...

If there is a desire to test the validity of the character entered (it is
within the allowed character range of this password - I.E., alpha-numeric or
standard "special" characters [presumably]), I would probably use the
!GET.KEY subroutine and presumably test the key entered against whichever is
shorter  - valid or invalid keys. If an errant character type is detected,
advise the operator accordingly, wipe out the password, and make the
operator retype from the beginning. This is not a test of the nth character
entered compared to the nth character of the password - just whether the key
pressed is valid; if it is valid, output the *.

The documentation is a little lacking, but I believe that !GET.KEY does not
do any of the limited character handling that KEYIN() will do.
However, speedy does not come to mind when I think of everything entailed in
doing this; the longer the password required, the less speedy it shall be.

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of andy baum
Sent: Tuesday, August 16, 2011 7:09 PM
To: U2 Users List
Subject: Re: [U2] Simple Masking of Password Input (Universe Basic)

Slight amendment in case your positioned in middle of screen.

       PASSWD = ''
       LOOP
          CHR = KEYIN()
       UNTIL CHR = CHAR(13) DO
          BEGIN CASE
             CASE CHR # CHAR(8)
                CRT "*":
                PASSWD := CHR
             CASE PASSWD # ''
                CRT CHAR(8):' ':CHAR(8):
                PASSWD = PASSWD[1,LEN(PASSWD)-1]
          END CASE
       REPEAT
       CRT
       CRT PASSWD

Cheers,
Andy


________________________________
From: nschroth <[email protected]>
To: [email protected]
Sent: Tuesday, 16 August 2011, 19:51
Subject: [U2]  Simple Masking of Password Input (Universe Basic)


Does anyone have a simple routine for entering a password and only
displaying an asterisk for the character entered?
--
View this message in context:
http://old.nabble.com/Simple-Masking-of-Password-Input-%28Universe-Basic%29-
tp32274238p32274238.html
Sent from the U2 - Users mailing list archive at Nabble.com.

_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to