home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "DebuggingLibrary"
- Option Explicit
-
- #Const DebugMode = True
-
- Public Function Assert(Condition As Boolean, Message As String) As Boolean
- If Not Condition Then
- #If DebugMode Then
- Dim style, Title
- style = vbCritical Or vbOKOnly
- Title = "ERROR MESSAGE"
- MsgBox Message, style, Title
- Stop
- #Else
- Dim FileName As String, FileNum As Integer
- Dim buf As String
- buf = Date$ & Chr$(9) & Time$ & Chr$(9) & Message
- FileName = App.Path & "\error.log"
- FileNum = FreeFile
- Open FileName For Append As #FileNum
- Print #FileNum, Date$, Time$, Message
- Close #FileNum
- #End If
- End If
- Assert = Condition
- End Function
-
-