Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Binary file write
#2
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.
Reply


Messages In This Thread
Binary file write - by eoredson - 09-23-2023, 02:44 AM
RE: Binary file write - by mnrvovrfc - 09-23-2023, 03:14 AM
RE: Binary file write - by eoredson - 09-23-2023, 03:57 AM
RE: Binary file write - by bplus - 09-23-2023, 07:12 PM
RE: Binary file write - by bplus - 09-23-2023, 06:56 PM
RE: Binary file write - by mnrvovrfc - 09-23-2023, 11:04 PM
RE: Binary file write - by eoredson - 09-24-2023, 01:26 AM
RE: Binary file write - by SMcNeill - 09-24-2023, 01:29 AM
RE: Binary file write - by SpriggsySpriggs - 09-25-2023, 11:30 AM
RE: Binary file write - by eoredson - 09-26-2023, 02:25 AM



Users browsing this thread: 2 Guest(s)