java line error discrepancies....

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Gareth

java line error discrepancies....

Post by Gareth »

For some strange reason with 4.5 and 4.6 I'm still getting a problem with certain java files I write from scratch. I will (on purpose) mispell a variable and for the compilation error I'll get, for example:

C:\Documents and Settings\Gareth\Desktop\434\question2\A1Q1.java:59: cannot resolve symbol
symbol : variable scurrentLine
location: class A1Q1
scurrentLine=in.readLine();
^
1 error

Tool completed with exit code 1

Now when I look at this line it is actually on line 30, not 59. Anybody else get this or......?
Stephan

Re: java line error discrepancies....

Post by Stephan »

Is it possible that there's some kind of *nix - Windows incompatibilities?

Note thta this is just a wild guess:
If your files come from one OS and are opened with a tool for the other, you might (or might not, that's why I call it a guess) get two line breaks instead of one.

Windows uses '\n\r' for 1 line break, *inxes use '\n', other OSes use '\r'.

That would more or less explain, why you get nealy twice [59 in your example] the line numer you expect [30 as you say].
Is that always the case?

Hope that helped.

Stephan
Post Reply