I've just fixed what should be a bug in a simple function to log a message to
a file. The thing is, the original code worked!
Protected Sub LogMessage(ByVal filename As String, ByVal message As
String)
Dim fileNum As Integer
fileNum = FreeFile()
FileSystem.FileOpen(FreeFile(), filename, OpenMode.Append)
FileSystem.PrintLine(fileNum, DateTime.Now.ToString + " - " + message)
FileSystem.FileClose(fileNum)
End Sub
I'm opening the file with one number and then using a different file number
to write the data! Surely the PrintLine and the FileClose should fail. But
the application works and logs mesages to the log file with no problems.
Can anyone explain?
--- Al.