Mistři v programování na #hovnokod

Visual Basic #589

Public Sub DBOpen(Optional sFullPath As String = "")
    If sFullPath = "" Then sFullPath = sPath
    Dim f As Integer
    Dim l As Integer
    Dim tmp As String
    Dim sName As String
    Dim sSurname As String
    Dim sSex As String
    Dim dBirthdate As Date
    Dim sCity As String
    Dim sStreet As String
    l = 0
    f = FreeFile
    Open sFullPath For Input As #f
        While Not EOF(f)
            Line Input #f, tmp
            l = l + 1
        Wend
    Close #f
    If l > 0 Then
        ReDim asDB(0 To l - 1) As clsCitizen
        l = 0
        f = FreeFile
        Open sFullPath For Input As #f
            While Not EOF(f)
                Input #f, sName, sSurname, sSex, dBirthdate, sCity, sStreet
                Set asDB(l) = New clsCitizen
                asDB(l).sName = sName
                asDB(l).sSurname = sSurname
                asDB(l).sSex = sSex
                asDB(l).dBirthdate = dBirthdate
                asDB(l).sCity = sCity
                asDB(l).sStreet = sStreet
                l = l + 1
            Wend
        Close #f
    End If
    sPath = sFullPath
End Sub

HovnoKod,