Results 1 to 2 of 2

Thread: binary File

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Location
    N.Ireland
    Posts
    3

    Unhappy binary File

    Does anyone know how to load a binary file, to an array.
    Harry Weir

  2. #2
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530
    Don't know exactly what you want, but this code may help as it shows how to read all data from any file into a byte array:

    VB Code:
    1. Private Sub Command1_Click()
    2. 'Read all data into byte array using get statement
    3.  
    4.  Dim ba() As Byte, ff&, i&, a
    5.  
    6.  ff = FreeFile
    7.  Open "c:\tmp\test.txt" For Binary As #ff
    8.  ReDim ba(0 To LOF(ff) - 1)
    9.  Get #ff, , ba
    10.  Close #ff
    11.  
    12.  For i = 0 To UBound(ba)
    13.     Debug.Print ba(i)
    14.  Next
    15. End Sub

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