home *** CD-ROM | disk | FTP | other *** search
- 'DEBUG: Routines used in debugging an app
- Option Explicit
- Option Compare Text
-
- '----------------------------------------------------
- ' These are variables used as constants
- Dim CRLF As String
- '
- Global Const DEBUG_FLAG = "/D"
-
- '----------------------------------------------------
- Declare Sub OutputDebugString Lib "Kernel" (ByVal lpOutputString As String)
- Global fDebug As Integer
- Dim nDebug As Integer
- Dim szDspChr As String
-
- 'Display an appropriate error message, and then stop the
- ' program. These errors should NOT be possible in the
- ' shipping product.
- Sub Assert (ByVal bFlag As Integer, Msg As String, ByVal bDie As Integer)
-
- If bFlag Then Exit Sub
-
- MsgBox Msg$, 48
- If bDie Then fCancel = True
-
- End Sub
-
- Sub EndODS ()
- If nDebug Then
- Close nDebug
- End If
- End Sub
-
- 'InitODS: Initialize variables needed for ODS routine
- ' CmdLine = Command line to test for debug flag: /D
- Sub InitODS (sDisplayChar As String, CmdLine As String, LogFileName As String)
-
- CRLF = Chr$(13) + Chr$(10)
- szDspChr = sDisplayChar
- fDebug = InStr(CmdLine, DEBUG_FLAG) > 0
- If Len(LogFileName) Then
- nDebug% = FreeFile
- Open LogFileName For Output As nDebug%
- Else
- nDebug% = 0
- End If
-
- End Sub
-
- Sub ODS (DspStr As String)
- If fDebug Then OutputDebugString szDspChr + DspStr + CRLF
- If nDebug Then Print #nDebug, DspStr
- End Sub
-
-