LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-15-2005, 09:35 PM   #1
Dutchman
LQ Newbie
 
Registered: Jun 2005
Location: Australia
Distribution: n/a
Posts: 4

Rep: Reputation: 0
I have a logical error here.


Hi all,
I have a logical error here somewere, but I can not see it.

public void findLines(BufferedReader in, String fileName) throws IOException
{
String line;

try
{
line=in.readLine();


findWords(line);
line=in.readLine();


}
catch(IOException e)
{
System.out.println("ERR1:Unable to open dictionary file "+fileName);
}
}

Can someone please help me to find it.
Thanks
Dutchman
 
Old 06-15-2005, 09:41 PM   #2
titanium_geek
Senior Member
 
Registered: May 2002
Location: Horsham Australia
Distribution: elementary os 5.1
Posts: 2,479

Rep: Reputation: 50
so what exactly is the error message, or is the code not working as expected?

titanium_geek

(ps putting the code in [ CODE ] [ / CODE ] tags makes it easier to read. minus spaces of course- I put them in so the syntax would show. )
 
Old 06-15-2005, 10:25 PM   #3
Dutchman
LQ Newbie
 
Registered: Jun 2005
Location: Australia
Distribution: n/a
Posts: 4

Original Poster
Rep: Reputation: 0
I have a logical error here.

You need to add these:
while(line!=null) { }

public void findLines(BufferedReader in, String fileName) throws IOException
{
String line;

try
{
line=in.readLine();

while(line!=null)
{
findWords(line);
line=in.readLine();
}
}
catch(IOException e)
{
System.out.println("ERR1:Unable to open dictionary file "+fileName);
}
}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I did not know about logical volumes gezi Linux - Newbie 5 04-27-2005 09:26 AM
Logical block error on install w1z4rd Mandriva 1 03-09-2005 04:56 AM
Primary or Logical? Brahl Linux - Newbie 1 01-29-2005 09:50 AM
Primary vs Logical djgerbavore Linux - Hardware 2 08-16-2004 06:02 PM
lilo and logical partition error iggymac Linux - Software 6 12-20-2001 11:50 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration