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