Visual Basic > Applications-VBA
use logging in your applications
use logging in your applications '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
Visual Basic Codes
ActiveX
Miscellaneous
Applications
Code Snippets
Common Dialogs
Special Effects
Database Stuff
Date Time
Files Drives
Forms
Graphics Games
Internet Stuff
Multimedia
Other
Strings
Windows