I'm trying to write a program so that when you type something it shows up as asterisks like for a password and it tells you if you have it right or wrong. What I have so far works but only if you get it right on the first try. I think the problem has to do with the "word:= word + pass" but I can't figure it out.
Quote:
var password := "123"
var pass : string (1)
var word : string := ""
loop
locate (1, 1)
put "Password " ..
locate (1, 10)
loop
getch (pass)
exit when pass = KEY_ENTER
word := word + pass
put "*" ..
end loop
if word = password then
cls
put "Hello"
exit
else
locate (1, 30)
put "Wrong password"
end if
end loop