Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!netnews.upenn.edu!hyper.lap.upenn.edu!garay From: garay@hyper.lap.upenn.edu (John Garay) Newsgroups: comp.lang.pascal Subject: RE: dots will echo... Message-ID: <41080@netnews.upenn.edu> Date: 13 Apr 91 06:07:43 GMT Sender: news@netnews.upenn.edu Distribution: na Organization: University of Pennsylvania, Language Analysis Project Lines: 49 Nntp-Posting-Host: hyper.lap.upenn.edu Thanks to Everyone who sent suggestions about the password entry. From all of those suggestions, here's what I built for TP3.01 on an IBM. {*****************} Procedure GetPassWd; Var Tempwd:string[15]; oldtemp:string[15]; Begin {GetPasswd} clrscr; write('Password (dots will echo): '); passwd:=''; tempwd:=''; oldtemp:=''; Repeat oldtemp:=tempwd; tempwd:=passwd; Read(kbd, ch); if (Ord(ch)<>13) and (Ord(ch)<>8) then Begin Passwd:=Passwd + ch; write('.'); End; if (Ord(ch)=8) then {Backspace} Begin write(ch); passwd:=oldtemp; {Put passwd minus one character} End; Until (Ord(ch)=13); {Until Enter is Pressed} End; {GetPassWd} {****************} The tempwd and oldtemp Vars allow the use of the backspace to correct the password if mistyped. It's not the cleanest code I've ever seen, BUT it get the job done. Thanks for the Help! ****************************************************************************** John Garay e-mail : garay@hyper.lap.upenn.edu Office phone : (215) 898-1954 Home Phone : (215) 382-4102 Donations : 4034 Walnut, Philly, PA 19104 "Change the Way People think, and things will Never be the Same." S. Biko ******************************************************************************