
Password program for QB 4.5
Quote:
> Newsgroups: comp.lang.basic.misc
> Subject: [News] Password porgram for QB 4.5
> Date: Tue, 19 Mar 96 04:52:22 GMT
> I have made a program I would like to password portect, the only problem I
> am having is that I can't get the words the user is typing in to look like
> "*"'s can anyone help?
Hi,Daniel!
Try this:
'
' Simple PassWord demo program. Use and enjoy !
'
DEFINT a-z
Colomn=1
Row=1
KeyWord$="HELLO"
PassLen=LEN(KeyWord$)
COLOR 7,0
CLS
LOCATE Row,Colomn
PRINT "Password, please = ";
'
PassWord$=""
COLOR 14,0
FOR i=1 to PassLen
c$=""
LOCATE ,,1
WHILE c$="" OR LEN(c$)=2 OR ASC(c$)=8 OR ASC(c$)=9
c$=INKEY$
WEND
LOCATE ,,1: PRINT "*";
PassWord$=PassWord$+c$
NEXT i
'
COLOR 7,0
IF PassWord$ = KeyWord$ THEN
PRINT " Excellent PassWord !"
ELSE
PRINT " Bad, bad, bad !"
END IF
'
END
'
'
Best wishes,
Alexander.