Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Binary file write
#1
Here is some annoying code for you:

Code: (Select All)
Type struct
    s As String
End Type

Dim structx As struct
structx.s = "abc": Print structx.s
Print Len(struct)
structx.s = "abcdef": Print structx.s
Print Len(struct)

Open "testfile.xxx" For Binary As #1
' UDT must have fixed size.
Put 1, 1, structx
Code: (Select All)
Dim x2(1 To 1024) As String
For l = 1 To 1024
    x2(l) = Str$(l)
Next
Open "filetest.xxx" For Binary As #1
' Cannot pass array of variable-length strings.
Put 1, 1, x2()
Maybe these can be tweaked someday!?

Erik.
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: 1 Guest(s)