[Gambas-bugtracker] Bug #1696: Write of a string[] to a MEMORY FILE only save or reads first element, lof() always returns zero on memory file

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Mon Dec 16 10:20:40 CET 2019


http://gambaswiki.org/bugtracker/edit?object=BUG.1696&from=L21haW4-

Comment #2 by Brian G:

Yes I know my calculation is false, but i need to guestimate the size as there is no way of know how long the storage required is before you write. there is no serialize function on an object which returns a size without writing first... catch 22

Anyway, the error in the reading of arraysof strings or any string from a memory file, is that the reader stops at the null terminating the string, and never reads past it for string arrays and puts everything off for other structures. The read position never increments past the null byte when trying to read strings from memory file. The work around, is to read every string individually then read a byte for the 0 terminator, repeat.

I hope its easy to fix.

Any Ideas on how to do a serialize without actually writing the data?

thanks




More information about the Bugtracker mailing list