Re: need yer opinion euphoria wizards

new topic     » goto parent     » topic index » view thread      » older message » newer message

>Could ya like polish up my password routine? There a few things it could
>use:
>1. Sort of a 'history' of keystrokes
>2. so that it can backspace previous multiple tabs
>3. Anything else you can think of


These are the last things I would want a password routine to do.
I would even prefer it, if the password is removed as soon as the window
looses focus. (for example caused by a screensaver) .. think about it.. the
possible misuse. A password is used when you dont trust those around you,
make you wonder though, if you are being in the right place.

Ralf


>here, part of user.e:
>global function password(object password)
>    --password getting function by matt1421 at juno.com
>    --When it comes to programming languages, Euphoria is a cut above
>    --Matt1421 at juno.com -- Euphoria programmer
>    object buffer,passwrd,pastbuf
>    sequence gpos
>    integer flag
>    flag=0
>    buffer=""
>    passwrd=""
>    while 1 do
>        pastbuf=buffer
>        buffer=wait_key()
>        if buffer=13 then
>            exit
>        end if
>        gpos=get_position()
>        if buffer=32 then
>            puts(1," ")
>        elsif buffer=9 then
>            puts(1,"    ")
>        elsif buffer=8 and length(passwrd)=0 then
>            puts(1,8)
>        else
>            puts(1,"*")
>        end if
>        if buffer=8 then
>           if length(passwrd)>0 then
>               if not compare(9,pastbuf) then
>                  position(gpos[1],gpos[2]-4)
>                  puts(1,"     ")
>                  position(gpos[1],gpos[2]-4)
>                  flag=2
>               else
>               position(gpos[1],gpos[2]-1)
>               puts(1,"  ")
>               position(gpos[1],gpos[2]-1)
>               buffer=""
>               for z= 1 to length(passwrd)-1 do
>                    buffer=buffer&passwrd[z]
>               end for
>               passwrd=buffer
>               flag=1
>            end if
>            end if
>            end if
>        if flag=0 then
>        passwrd=passwrd&buffer
>        end if
>        flag=0
>    end while
>    if compare(upper(passwrd),upper(password)) then
>        return 0
>    else
>        return 1
>    end if
>end function
>
>
>-------------------------------------
>When it comes to programming languages, Euphoria is a cut above -
>matt1278 at juno.com and matt1421 at juno.com(and soon to be
>irisnmatt at prodigy.net. Then again, maybe not) Euphoria programmer
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu