--------------------
Dim BArr() as byte, f as byte
f=freefile
Open "MyFile.txt" for Binary access read as #f
redim Barr(lof(f))
get #f,,Barr
close #f
'Barr is now a byte array of the file
--------------------
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
I've used this before to copy file byte by byte. Perhaps it'd help you along the way
Open "c:\mijn documenten\mark.xls" For Binary As #1
Open "c:\mijn documenten\test.xls" For Binary As #2
Dim chara As Byte
Do While Not EOF(1)
Get #1, , chara
Put #2, , chara
Loop
Close #2
Close #1
--------------------------------------
It's not the monsters under your bed, it is the men next door.
That make you fear, make you cry. Make you cry for the Child.
All the wars are fought amongst those lonely men. Unharmed, unscarred.
anders75
Which language are you programming in (it looks like c or java...)?
Try
--------------------
Dim BArr() as byte, f as byte, i as long
f=freefile
Open "MyFile.txt" for Binary access read as #f
redim Barr(lof(f))
get #f,,Barr
close #f
i=0
do
f=Barr(i)
i=i+1
if i>Ubound(barr) then msgbox "all bytes are zero in file!": exit do
loop until f<>0
--------------------
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.