how come you cant just copy the txt version of a jpg file into anotehr jpg file so it sorta duplicates the file? i dunno y.. pls someone explain it....
Printable View
how come you cant just copy the txt version of a jpg file into anotehr jpg file so it sorta duplicates the file? i dunno y.. pls someone explain it....
You can. You just have to read the file in binary mode.
Hope this helps.Code:
Private Sub Command1_Click()
Open "doc017.gif" For Binary As #1
tmp_var$ = Space(LOF(1))
Get #1, , tmp_var$
Close #1
Open "newdoc.gif" For Binary As #1
Put #1, , tmp_var$
Close #1
End Sub
The reason is that JPG's, GIF's and other image/binary files contain characters that aren't in the ASCII set. If you try and copy them into a string, some characters won't be read or will be translated incorrectly. Now imagine trying to write them back into another file with characters corrupted, then the file viewer trying to display that.:D Icch!:eek: