11-28-2024, 02:02 PM
Nice work, Steve. It depends on the programmer's approach, I realized. While you are providing a way to do it, I was looking for reasons not to do it
It will work via binary access as you write here, but it won't work via Input and a file opened for reading, because some characters control the behavior of the input command in Open for Input mode.
The following program shows how binary text can confuse the Input command when reading a binary file.
It will work via binary access as you write here, but it won't work via Input and a file opened for reading, because some characters control the behavior of the input command in Open for Input mode.
The following program shows how binary text can confuse the Input command when reading a binary file.
Code: (Select All)
For a = 0 To 255
f$ = Chr$(a) + f$
Next a
ff = FreeFile
Open "binTest" For Binary As ff
Put ff, , f$
Close ff
ff = FreeFile
_ControlChr Off 'not for operations in file, just for printing...
Open "binTest" For Input As ff
Dim b As String
Do Until EOF(ff)
Input #ff, b$ 'or try LINE INPUT, returned string is not returned in full lenght
Sleep
Print b$, Len(b$)
Loop
Close ff