Results 1 to 3 of 3

Thread: im confused about files and stuff come in

  1. #1

    Thread Starter
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217

    im confused about files and stuff come in

    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....
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  2. #2
    Hyperactive Member
    Join Date
    May 2000
    Location
    Or
    Posts
    316
    You can. You just have to read the file in binary mode.

    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
    Hope this helps.

  3. #3
    WALDO
    Guest
    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. Icch!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width