04-12-2023, 10:20 PM
(04-12-2023, 10:14 PM)DSMan195276 Wrote:(04-12-2023, 05:59 PM)bplus Wrote: Oh yes, one more thing. UDT's have never been fixed for saving to file variable length strings.
So if you save to file a UDT it must be like the old days with fixed string lengths only!!!
Another clarification This isn't really a bug, it's not supported and unlikely to ever be supported since it's not clear how to make it work in a sane way.
As for the bug with Redim, I have it figured out. Basically what's going on is that with a normal Redim _Preserve the new memory (if any) is supposed to get zero'd, but when a Type contains a variable-length String that logic gets left out. We do already have logic to initialize all the new variable-length strings, so you should find the variable-length strings work and are always empty, but anything else in the Type will potentially contain garbage. I think this should be relatively easy to fix, I'll make a GitHub issue for it.
Save to a second file (say *.vlsd for variable length string data) and only have the main file store offset + size.