1. RE: Password prompt routine
- Posted by sephiroth _ <euman2376 at yahoo.com> Aug 17, 2001
- 392 views
coords=get_position() position(coords[1],coords[2]-1) puts(1,' ') position(coords[1],coords[2]-1) viola, problem solved and what's wrong with the UNIX way?
2. RE: Password prompt routine
- Posted by Graeme <graemeburke at hotmail.com> Aug 18, 2001
- 398 views
Here's one... -----<khkhkjll>------------- include graphics.e --for get_position() include get.e --for wait_key() constant BackSpace=8, CursorLeft=331, EscapeKey=27, ReturnKey=13 function getPassword(sequence prompt) sequence pos,r integer k r={} puts(1,prompt) pos=get_position() k=wait_key() while not find(k,{EscapeKey,ReturnKey}) do if find(k,{CursorLeft,BackSpace}) then --Backspace if length(r)>1 then r=r[1..length(r)-1] else r={} end if else r&=k -- Add char to string end if position(pos[1],pos[2]) -- puts(1,repeat('*',length(r))&' ') --Redraw Display position(pos[1],pos[2]+length(r)) -- k=wait_key() --get next char end while if k=ReturnKey then --Return return r else --Cancel return {} end if end function puts(1,"\n\n"&getPassword("Enter Password :")) ---------<gikrshg>---------------- Graeme