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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only