On 1/3/17, Tony Whyman <tony.why...@mccallumwhyman.com> wrote: > Today, I also came up against the problem of how to read a password from > the console without echo. With a bit of googling and code bashing, I > have created the following cross-platform code from a "getpassword" > function. > > repeat > read(c); > if c = #10 then break; > write('*'); > Result += c; > until false;
That does not handle BackSpace (or any other "special key") AFAICS? Reminds me of one of my program I wrote > 2 years ago. You could have backspace and escape in your password ;-) I later implemented an inputfield (using crt unit and reading key-input using BIOS routines) that behaved just like an edit control, so it would correctly handle left, right, delete, backspace etc. Ahh, the good old days of Turbo Pascal. Sorry, getting a bit sentimental. Bart _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal