DEV Community

Discussion on: I Just Finished My First Year of BSc Computer Science at University, Ask Me Anything!

Collapse
 
natonathan profile image
Nathan Tamez

Henry remember this.

Dim output As String
    'Old Delete Block
    If File.Exists(fileName) = True Then
        File.Delete(fileName)
        Debug.WriteLine("file deleted ")
    End If
    'Using fs As FileStream = File.Create(fileName)
    '    For Each t In coastalTowns
    '        output = New UTF8Encoding(True).GetBytes(String.Format(myFormat, t.name, t.county, t.population, t.area))
    '        fs.Write(output, 0, output.Length)
    '    Next
    'End Using
    FileOpen(2, fileName, OpenMode.Random, , , 43)
    Debug.WriteLine(Len(town))
    While EOF(2)
        For Each T In coastalTowns
            If Not T.name = "" Then
                output = (String.Format(myFormat, T.name, T.county, T.population, T.area))
                FilePut(2, output)
            End If

        Next

    End While

The obsolete code we had to use. haha

Thread Thread
 
badrecordlength profile image
Henry 👨‍💻

My god, yes I do. FilePut(), FileOpen() and FileClose() are bring back horrid memories from my A Level coursework hahahaha. One of the reasons I'm very glad my VB days are behind me.