All pastes #332133 Raw Edit

while-if loop

public text v1 · immutable
#332133 ·published 2007-01-29 19:19 UTC
rendered paste body
'This class facilitates the reading and writing of the comma seperated configuration file

Public Class ManageConfig
    Public Function ReturnValue(ByVal File As String, ByVal SearchString As String, ByVal Type As String)
        Dim oRead As System.IO.StreamReader
        Dim oFile As System.IO.File
        Dim rawData As String
        Dim tmpArr() As String

        oRead = oFile.OpenText(File)
        While oRead.Peek <> -1
            rawData = oRead.ReadLine()
            tmpArr = Split(rawData, ",")
            If tmpArr(0) = Type Then
                If tmpArr(1) = SearchString Then
                    Return tmpArr(2)
                End If
            End If
        End While
    End Function
End Class