
-----------------------------------
con.focus
Sat Jan 08, 2005 4:36 pm

Password program help
-----------------------------------
K im make a pass word file that covers the password over with stars
the program has a big problem

which is if an incorect password is enter first it will  and then the corect password is entered it does n't reconize it

this does not happen when the correct pwd is enter the first time
var key : string (1)
var password : string := ""
var counter : int
counter := 0
loop
    loop
        getch (key)
        exit when ord (key) = 10
        put "*" ..
        password += key
    end loop
    put ""
    counter += +1
    if counter = 3 then
        quit
    elsif password = "sze" then
        exit
    end if
end loop
put ""
put "Welcome to Scotia Bank"


can ne 1 help

-----------------------------------
Andy
Sat Jan 08, 2005 4:44 pm


-----------------------------------
dont do it that way
just use setscreen("noecho")
and then everytime a key is pressed, output a "*"

-----------------------------------
con.focus
Sat Jan 08, 2005 4:49 pm


-----------------------------------
wut exactly do u mean

-----------------------------------
Andy
Sat Jan 08, 2005 4:54 pm


-----------------------------------
make a new program, and at the very top put setscreen("noecho")
and then write a program that gets someones name, run it and u'llsee what i mean

-----------------------------------
con.focus
Sat Jan 08, 2005 4:57 pm


-----------------------------------
i did that but the only thing it write at is enter wont lets u inout other chars


btw is there a command that will resart ur program

-----------------------------------
Andy
Sat Jan 08, 2005 5:05 pm


-----------------------------------
err u can put it in a loop.. or u can make it an exe and use Sys.Execute

and btw... that program i told you to write dos input letters, you just cant see it being inputted which is the whole point of hiding it.. ah wells, here is a password program i wrote a while back


fcn getpass : string
    var pass := ""
    var charc : string (1)
    loop
        getch (charc)
        exit when ord (charc) = 10
        if ord (charc) = 8 and length (pass) not= 0 then
            locate (whatrow, whatcol - 1)
            put " " ..
            locate (whatrow, whatcol - 1)
            pass := pass (1 .. length (pass) - 1)
        elsif ord (charc) not= 8 then
            pass := pass + charc
            put "*" ..
        end if
    end loop
    put ""
    result pass
end getpass

put getpass


-----------------------------------
con.focus
Sat Jan 08, 2005 5:27 pm


-----------------------------------
yo thx ne way but i just realized that this line
 password+= key 
is acting like this one
counter += +1
all i needed to do was reset the variable at the end of the loop
