Binary File Access

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simon Morris

    #1

    Binary File Access

    In VB6 I readed data with this code:
    ---------------------------------------------------------
    Open App.Path & "\SI Map.map" for Binary As #1
    Get #1, , lngCount
    ReDim SI(lngCount) as MapPoints
    Get #1, , SI()
    Close #1
    ---------------------------------------------------------
    In VB.NET

    Structure MapPoint
    Public GridEast As Single
    Public GridNorth As Single
    End Structure

    Dim SouthIsland(200 0) As MapPoint
    Dim lngCount As Long
    Dim ReadString As String

    ReadString = CurDir() & "\SI Map.map"
    FileOpen(1, ReadString, OpenMode.Binary )

    FileGet(1, lngCount)
    FileClose(1)

    lngCount should = 1747. If I change FileGet(1, lngCount) to FileGet(1,
    SouthIsland) I can read all the data but I need
    to know the number of records.

    Thanks, Simon.





Working...