13-10-2007, 07:01 PM
Most any language that can perform file I/O can create null-terminated strings. :wink: I prefer string size headers myself, since you can define the length then grab the whole string at once instead of this "one byte at a time" stuff. What Robin said, though, would be the easiest approach. Though, why is there so many fixed length strings anyways? I can't really see it being for performance with so many string functions used like Trim$(), Left$(), Right$() and Mid$(), and it just ends up taking more RAM unless you actually use the defined length every time (which I doubt). I have never had problems with binary file I/O in VB6 with variable-length strings when just using:
Put #x,, MyTypeWithMyString
or
Put #x,, MyString
Put #x,, MyTypeWithMyString
or
Put #x,, MyString