Option Strict Off
Option Explicit On
Friend Class Tmapfile

    Public File As String
    Dim numitems As Integer

    Private names(800) As String
    Private types(800) As String



    Sub read()

        Dim var As String
        Dim strs() As String
        Dim i As Integer


        FileOpen(136, File, OpenMode.Binary, OpenAccess.Read)
        var = LineInput(136)
        i = 0
        For i = 0 To 800
            If EOF(136) = True Then
                Exit For
            End If

            var = LineInput(136)
            strs = Split(var, ",", 6)
            types(i) = strs(1)
            names(i) = "[" & strs(3) & "] " & strs(4)
        Next
        numitems = i ' set the number of items read
        FileClose(136)
    End Sub

    Public Function getname(ByVal i As Integer) As String
        If i < 0 Or i >= numitems Then
            getname = "OOR"
        Else
            getname = names(i)
        End If
    End Function


    'UPGRADE_NOTE: gettype was upgraded to gettype_Renamed. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
    Function gettype_Renamed(ByVal i As Integer) As String

        If i < 0 Or i >= numitems Then
            gettype_Renamed = "OOR"
        Else
            gettype_Renamed = types(i)
        End If
    End Function
End Class