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.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement