Hello All,
I am creating a VB App that will merge/combine two binary files into one large file. I am using the Open command to open the file in binary read mode and the output file in binary write mode. But somehow the two files are not merging. I only see the 2nd file in the document. So when i use the Get and Put commands to create a new file, it only displays the 2nd file instead of both files (One appended after the other).
Can anyone please shed some light on how to combine two binary files in VB? I would really appreciate your help.
thanks,
My Code:
FileNum2 = FreeFile
Open bfilename3 For Binary Access Write As #FileNum2
For RecordNumber = 1 To 2
FileNum1 = FreeFile
Open bfilename For Binary Access Read As #FileNum1
fl = FileLen(bfilename) - 1
ReDim binbyte(fl)
Get #FileNum1, , binbyte
Close #FileNum1
Put #FileNum2, , binbyte
Next
I am creating a VB App that will merge/combine two binary files into one large file. I am using the Open command to open the file in binary read mode and the output file in binary write mode. But somehow the two files are not merging. I only see the 2nd file in the document. So when i use the Get and Put commands to create a new file, it only displays the 2nd file instead of both files (One appended after the other).
Can anyone please shed some light on how to combine two binary files in VB? I would really appreciate your help.
thanks,
My Code:
FileNum2 = FreeFile
Open bfilename3 For Binary Access Write As #FileNum2
For RecordNumber = 1 To 2
FileNum1 = FreeFile
Open bfilename For Binary Access Read As #FileNum1
fl = FileLen(bfilename) - 1
ReDim binbyte(fl)
Get #FileNum1, , binbyte
Close #FileNum1
Put #FileNum2, , binbyte
Next