May 19, 2024, 10:17:43 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


A custom made scintilla lexer for ebasic

Started by sapero, October 25, 2009, 11:03:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

aurelCB

Ficko
as i say i have 50 lines of code but when i load this 50 lines i see in control
last 51 lines as line number not 50?
do you understand now...

sapero

I think your code is wrong, because you are appending 13,10 to the end of each loaded line:

original file - two lines:
line 1 <13><10>
line 2 <EOF>

Your buffer - three lines:
line 1 <13><10>
line 2 <13><10>


Try to load the whole file into memory with single READ, not line by line. Or append 13,10 to your buffer just before appending next line:
read(ln)
buffer = ln

do
  if (read(ln)=0)
    buffer = buffer + chr$(13) + chr$(10) + ln


Notice also that a line of text can be >255 characters, and the READ function does not allow you to limit the number of returned bytes. You must supply buffer large enough to accept data returned by READ function, so for text files better is to read the data in binary mode.

aurelCB

I give up dont work properly.
I will stay with last empty line.
In your case i have first line empty.