Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Display asterisks password
Message
From
26/11/2000 18:08:37
 
 
To
25/11/2000 15:29:23
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00445392
Message ID:
00445528
Views:
14
In FPD 2.6 and in FPW 2.6 I wrote this code, which returned a character string user entered:

******************************

procedure psw_input
private all except cPass
push key clear
define window a from 10,15 to 12,65 color w+/r shadow
activate window a
@ 0,1 say "Password:"
nCounter = 1
bStop = .f.
cPass = ""

do while bStop = .f.
nChr = inkey(0,"H")
if nChr < 0
loop
endif
if nChr = 5 or nChr = 24 or nChr = 4
loop
endif
if nChr = 27 &&Escape key
bStop = .t.
cPass = ""
loop
endif
if nChr = 13 &&Enter key
bStop = .t.
loop
endif
if bStop = 127 or bStop = 19 &&Backspace or left key...
if nCounter > 1
nCounter = nCounter - 1
@ 0,(7+nCounter) say " "
cPass = left (cPass, nCounter - 1)
endif
loop
endif

@ 0,(7+nCounter) say "*" color w+/r
cPass = cPass + chr(nChr)
nCounter = nCounter + 1

if nCounter > 40
bStop = .t.
endif
enddo

pop key all
release window a

return cPass

***********************************

HTH, Zlatko.
Previous
Reply
Map
View

Click here to load this message in the networking platform