>Ok, but what happen when the file is very large? More than 1 MB
Héctor,
The following code is untested. It is supposed to read a 10-byte record at a time, starting at the beginning of the file.
lnFile = fopen("MyBinaryFile.bin")
if lnFile < 0
MessageBox("Error opening file.")
else
do while not feof(lnFile)
lcBytes = fread(lnFile, 10)
DoSomething(lcBytes)
enddo
endif
fclose(lnFile)
HTH, Hilmar.
I used the low-level file functions a lot to get data from a legacy system. At that time, I hadn't learned yet to use FileToStr() and alines(). Would have worked, since the files were not extraordinarily large!
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)