CreateLog




'if you want logging then set VB4 menu

'Tools/Project/Advanced/CommandLine Arguments = /D

Public Sub WriteLogFile(szData As String)
'-- File handle for the log file (if used)

Static nLogFileNum As Integer

On Error Resume Next

If InStr(UCase$(Command$), "/D") Then
'-- Is the file not open yet?

If nLogFileNum = 0 Then
'-- Open it

nLogFileNum = FreeFile
Open App.Path & "\" & App.EXEName & ".LOG" For Binary Shared As nLogFileNum
Seek #nLogFileNum, LOF(nLogFileNum) + 1
End If

'-- Write the string

szData = Str$(Now) & Chr$(9) & szData & vbCrLf
Put #nLogFileNum, , szData

End If

End Sub











( createlog.html )- by Paolo Puglisi - Modifica del 17/12/2023