My opinion: Require the user add a size field before the string in a TYPE.
TYPE foo
X AS INTEGER
Y AS INTEGER
Name.size AS _BYTE (INTEGER, LONG, _INTEGER64)
Name AS STRING
END TYPE
Without the variable string NAME.size, we'd toss an error message -- "Variable length string requires size definition in TYPEs".
The advantages of this are:
1) Minimal file size usage. The user can set if 255 bytes would be enough for their STRING, or if they need integer/long/int64 size strings).
2) It's a visible reference to the data structure of the file. If the process was automatic, it might lead to confusion if trying to port the file into another program.
3) It could allow the user to only send part of a string to the file.
Example 3:
MyType_String = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ"
MyType_String.size = 10 'only put a stub of the first 10 characters into the file
PUT #1, , MyType
By default, the QB64 would set the size to the data limit (255 for unsigned byte), or the size of the string (36 in this case), but it'd give the user a chance to set it lower, if desired.