09-23-2023, 03:14 AM
LOL. VLS member inside UDT. Object-oriented programming in QB64, here we come!
The array of strings problem you presented is for the simple reason that it will have to write the lengths of the string, at the time the file is being created and written to. Otherwise how are you going to tell one string member from another later?
By making all members of a specific length, you are helping the QB64 compiler indicate where one string starts and where it ends, out of many thousands potentially.
Much binary code must store the length of the string first of all before writing the string. This is the only way (at a low level) to reliably bring back data to the state it was when a file had to be created to hold those strings and other stuff.
What are you trying to do with the array of VLS's anyway?
Just create an UDT which in the least, there is an integer length, and the other member is a fixed-length string. Must make the string as large as you think a single string member could be. It sucks, but that is the most sane way to go about things.
The array of strings problem you presented is for the simple reason that it will have to write the lengths of the string, at the time the file is being created and written to. Otherwise how are you going to tell one string member from another later?
By making all members of a specific length, you are helping the QB64 compiler indicate where one string starts and where it ends, out of many thousands potentially.
Much binary code must store the length of the string first of all before writing the string. This is the only way (at a low level) to reliably bring back data to the state it was when a file had to be created to hold those strings and other stuff.
What are you trying to do with the array of VLS's anyway?
Just create an UDT which in the least, there is an integer length, and the other member is a fixed-length string. Must make the string as large as you think a single string member could be. It sucks, but that is the most sane way to go about things.