Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Binary file write
#5
(09-23-2023, 03:57 AM)eoredson Wrote:
Quote:What are you trying to do with the array of VLS's anyway?
I have a Screen Editor dimensioned a large array I am writing to the file using binary write variable length string array which is slow.

Binary write because Linux might strip 013 ascii from the file.

For example:

Code: (Select All)
Linux = -1
Dim Array(1024) As String
For L = 1 To 1024
    Array(L) = Str$(L)
Next

Open "testfile.xxx" For Binary As #1
For L = 1 To 1024
    X$ = Array(L)
    For X = 1 To Len(X$)
        Y$ = Mid$(X$, X, 1)
        Put 1, , Y$
    Next
    If Linux Then
        Z$ = Chr$(10)
        Put 1, , Z$
    Else
        Z$ = Chr$(13)
        Put 1, , Z$
        Z$ = Chr$(10)
        Put 1, , Z$
    End If
Next
End

Note: You cannot Put 1,,Chr$(10) or Put 1,,Asc(Chr$(10))

Ah now we get to real problem! Trying to please Linux and all it's possible flavors.

Well I leave that up to @mnrvovrfc ;-)) like that's not old too LOL
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
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

Possibly Related Threads…
Thread Author Replies Views Last Post
  BINARY FILE write pmackay 6 699 09-29-2025, 01:06 PM
Last Post: dakra137
Question fast file find with wildcards, optional date range, match # bytes, binary compare? madscijr 8 1,312 12-19-2024, 03:55 PM
Last Post: SpriggsySpriggs
  Write data to EXE file Steffan-68 8 1,987 05-15-2023, 06:41 PM
Last Post: Steffan-68

Forum Jump:


Users browsing this thread: 1 Guest(s)