CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 1999
    Posts
    1

    URGENT: how do you read in a binary data file?



    How do you read in a binary data file and save it into an array of records?

    I have the basic code for opening a file for input

    open "test.dat" for binary As #1

    get #1, , EmpDB

    get #1, , Current

    get #1, , Counter

    close #1


    and


    open "test.dat" for binary As #1

    put #1, , EmpDB

    put #1, , Current

    put #1, , Counter

    close #1


    but every time I access it, the data that I saved is not there!

    any help would be apprciated it!

  2. #2
    Join Date
    May 2000
    Location
    Nottingham UK
    Posts
    22

    Re: URGENT: how do you read in a binary data file?

    Not sure if this is the answer, but I think you may need to get VB to allocate you a File number rather than giving it #1 Eg.

    fin=freefile
    open "test.dat" for binary as #fin




    otherwise it does weird stuff.

    Scott

    ---
    Freeware VB programs at http://net23uk.freeservers.com

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

Featured