| Author |
Boolean Method Problem
|
Olivier Legat
Ranch Hand
Joined: Nov 17, 2007
Posts: 176
|
|
Hello everyone, I got this method which is meant to check if a name exists or not in a Random Access File. Basically, before I add an extra, I need to run this method to make sure that that line doesn't already exist somewhere else in the file. But no matter what happens it ALWAYS returns false Here's the code: Any ideas why this is happening?
|
Olly
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 9946
|
|
if the file is not too big, try putting in some print statements to see what the strings are it's comparing at each step. I usually do something like system.out.println("|" + myString + "|"); the pipes let me know EXACTLY where the string starts/ends in case there is whitespace on the beginning or end i may not see otherwise.
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
Olivier Legat
Ranch Hand
Joined: Nov 17, 2007
Posts: 176
|
|
Wow! That's really helped Fred Rosenberger. I found the problem. Thanks loads
|
 |
 |
|
|
subject: Boolean Method Problem
|
|
|