Results 1 to 4 of 4

Thread: Binary Files

Threaded View

  1. #1

    Thread Starter
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Binary Files

    How can I create a binary file to look like the attached if opened in Notepad (combination of text and characters)?

    I've used the below code but when I open the file in Notepad it displays the word 'TEST'.

    Any suggestions?

    vb Code:
    1. Dim b() As Byte
    2. Open App.Path & "\test.abc" For Binary As #1
    3. s = "TEST"
    4.  
    5.     ReDim b(5) As Byte
    6.    
    7.     For i = 1 To Len(s)
    8.     'Now get details
    9.    
    10.     b(i - 1) = Asc(Mid$(s, i, 1))
    11.     Next
    12.        
    13.    
    14.     Put #1, , b()
    15.     Close #1
    Attached Images Attached Images  

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