Because the if/else/print"no" is inside the while loop it will be executed once for each line in the file. Your logic should check for the password being in the file, then display the frame or the error afterwards. Something like this (pseudo-code)
boolean passwordFound = false
read each line of the file...
if password matches set passwordFound = true
after end of file...
if (passwordFound) show frame
else show error message
JamesCherrill
... trying to help
8,527 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,456
Skill Endorsements: 30
Also the message: No is not too useful. Better for debugging would be to print out the values of line and r.password so you cann see what the computer is seeing so you'd know why the if test failed.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Question Answered as of 8 Months Ago by
JamesCherrill
and
NormR1