'thanks to Carl Franklin
'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
Return