• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

condition seems to fail even if its true..

 
Accela Moon
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


The code is not yet complete, so I set the authCheck in the method for testing. For some reason, it keeps saying login error all the time even if I made sure the condition is true.. simply true. Anyone know wus wrong?
[ April 15, 2004: Message edited by: Accela Moon ]
 
Tobias Hess
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

This needs braces, like here:
 
Accela Moon
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, thanks.. you're right. But it doesn't make a difference..
 
C. Nimo
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
Your if statement checks the following:

are you sure that at the time of this check authCheck is true?
Nimo.
 
Accela Moon
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup, its true.. strange, when I use admin as username and password, it works. The previous variation of this code compared user input with that, but I've edited it out.. is there a chance this might be the compiler's fault and not the code?
 
C. Nimo
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, there's always a chance for that.
Delete all your *.class files and try again?
Use your IDE's debugger or SOP the values at critical points.
Cheers.
Nimo
 
Accela Moon
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know the problem, in the main below, my friend created an object from another class which wasn't supposed to be there thus ended up using the method there instead. Didn't notice.. Thanks anyways.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic