When I was a Junior programmer I wrote pretty much the same piece of code.
Unfortunately the users hated it!
For the sake of displaying something when they typed a password they lost the ability to correct typing mistakes.
Because with INPUT,1 the Backspace key doesn't work!
So I had to go back to the drawing board and eventually ended up writing a Line Editor ;-).

On 17/08/2011 18:15, nschroth wrote:
Thanks for all the suggestions.  I went with a variation, using ECHO OFF/ON
and and specific screen position for the input.  Had problems detecting
CHAR(13). Learned that INPUT @ screws up things, so utilized the CRT@ for
positioning.  I'll look into adding backspace handling next. Here is what I
ended up with:

PROMPT ''
INCHAR='X'
PASSWD=''
CRT @(0,5):'Enter Password: ':
ECHO OFF
POS=16
LOOP UNTIL INCHAR=''
CRT @(POS,5):
INPUT INCHAR,1:
PASSWD:=INCHAR
CRT @(POS,5):'*'
POS+=1
REPEAT
ECHO ON



Israel, John R. wrote:
That's actually pretty good!


John Israel
Senior Programmer/Analyst
Dayton Superior Corporation
1125 Byers Road
Miamisburg, OH  45342

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Mark Eastwood
Sent: Tuesday, August 16, 2011 3:43 PM
To: U2 Users List
Subject: Re: [U2] Simple Masking of Password Input (Universe Basic)

Just a quick sample

   PROMPT ''
   PW=''
   ECHO OFF
   LOOP
      INPUT X,1:
      IF X = '' THEN EXIT
      IF X THEN PRINT '*':
      PW := X
   REPEAT
   ECHO ON
   PRINT
   PRINT PW


-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of nschroth
Sent: Tuesday, August 16, 2011 1:52 PM
To: u2-users@listserver.u2ug.org
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
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to