
-----------------------------------
KONjbnj
Wed Apr 27, 2005 8:12 am

Need help with password
-----------------------------------
I need to create a program that when i need to get something from the user it puts it in asterisks like a password (like when you log into hotmail)


Thanks
KonjBnj

-----------------------------------
mksound
Wed Apr 27, 2005 8:41 am

re
-----------------------------------
hmm............... figure it out.....

-----------------------------------
jamonathin
Wed Apr 27, 2005 9:01 am


-----------------------------------
You need to var something : string := "" (equal to nothing)
then you need to var something_else: string (1)
Now you need to use getch, and whenever the user inputs a letter, clear last screen, and add the input to something.  Then use a for loop that uses the length of something, and have it display "*" or whatever for how many times it goes through that for loop.  And just have the program exit when enter is elsected or something.
** The program must be looped **
hmm............... figure it out.....
Those are words spoken of someone who doesn't know the answer himself.  :P

-----------------------------------
KONjbnj
Wed Apr 27, 2005 1:36 pm


-----------------------------------
Ok that makes sense just that im still a noob at turing and dont know things like getch so can you plz show the source code or part of it 


Thanks
KonjBnj

-----------------------------------
jamonathin
Wed Apr 27, 2005 1:40 pm


-----------------------------------
Here's a tip.

getch (hold)
cls
thing += hold

Look up getch to see what type of variable you need, and remember that thing stores hold.

*** Hit F10 ***

-----------------------------------
KONjbnj
Wed Apr 27, 2005 1:45 pm


-----------------------------------
I still dont get it that much plz help

-----------------------------------
jamonathin
Wed Apr 27, 2005 1:51 pm


-----------------------------------
You're not gettin any more source code after this.  Look up the vars and whatnot, and when you go to replace the letters, use a for loop like this.
for i : 1 .. length (thing)
Reason you want to display however many letters there are in the password with *'s.  The reason I'm not giving you any mre source code, is because there isn't much left, and this sounds like an assignment for school.

-----------------------------------
Bacchus
Wed Apr 27, 2005 6:36 pm


-----------------------------------
var letter:string(1) %this declares the variable to hold the tmp letter
var password:string:="" %setting a blank var to nothing to hold pass
loop
getch(letter) %this will get the letter you want
password+=letter %after done, this will hold what they inputted
put "*".. %puts the asterixs for each things they type
end loop i didnt do all, liek you would want a way to exit the loop, check ord in f10 and figure out :P

-----------------------------------
McKenzie
Wed Apr 27, 2005 6:50 pm


-----------------------------------
Make sure you set your screen to noecho or you will defeat the purpose:
View.Set("noecho")

-----------------------------------
mike200015
Wed Apr 27, 2005 8:45 pm


-----------------------------------
wat does noecho do??

-----------------------------------
Bacchus
Wed Apr 27, 2005 8:55 pm


-----------------------------------
if u use getch or get then it wont put the letters on the screen when you press the key

-----------------------------------
mike200015
Wed Apr 27, 2005 11:20 pm


-----------------------------------
with getch, it doesn't put the letters on the screen anyway
