Page 1 of 1

lines in file too long for string...

Posted: Sat Nov 01, 2003 5:41 pm
by muab256
heyas!

have some problem here to process a (text) file.
some lines seem to be too long for beeing read (or placed into
a string)...

anybody knowing a workaround?

thx
muab

Posted: Sat Nov 01, 2003 5:46 pm
by Karbon
How long is the line?

String type variables are limted to 64k (with most of the string functions further limiting that to 63999 bytes)..

You could use memory buffers for storing the data but manipulating those is a little tricky..

Check out this http://www.purebasic.org/comments.php?id=12_0_1_0_C7 for a few functions to help - though that might not be a total solution depending on what you're trying to do..

Also, check out the fastfile library from the announcements forum, viewtopic.php?t=5655&start=30

Posted: Sat Nov 01, 2003 5:53 pm
by muab256
umm.. im rather newbie....

id be satisfied if i could get the data... it wouldnt have to be
that 1 line is in one string if this would be easier to manage?

Posted: Sat Nov 01, 2003 5:55 pm
by Karbon
Ok, so how long is the line that you're trying to read? :-)

Posted: Sat Nov 01, 2003 6:02 pm
by muab256
okis, so far (the peak) is 5023

thx

muab

Posted: Sat Nov 01, 2003 6:29 pm
by Karbon
I thought you were trying to read a line of text from a file :-)

Don't know about the editor problems, have you checked out JaPBE? It's an alternate editor - check the announcements forum for a download link.

Posted: Sat Nov 01, 2003 6:32 pm
by muab256
hehe, the problem was:

how to count it? ;P

so i loaded it with the editor...

but the better way was: look for the longest line in a file, delete the
others and read the filesize ;P

Posted: Sat Nov 01, 2003 9:02 pm
by Karbon
Oh.. ok, lets back up.

What error or problem are you having when trying to read this line. Is your program crashing?

Posted: Sun Nov 02, 2003 2:29 pm
by muab256
umm... =(

finally i was too quick believing it was the fault of purebasic ;/

sorry for that...

muab