VERSION 2.00
Begin Form SamSpade 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Sam Spade, the Visual Basic runtime debugger"
   ClientHeight    =   6420
   ClientLeft      =   3915
   ClientTop       =   2100
   ClientWidth     =   7305
   Height          =   6795
   Icon            =   SAMSPADE.FRX:0000
   Left            =   3870
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   6420
   ScaleWidth      =   7305
   Top             =   1770
   Width           =   7395
   Begin CommandButton EndTheApp 
      Caption         =   "End Application"
      Height          =   330
      Left            =   2850
      TabIndex        =   45
      Top             =   5940
      Width           =   1620
   End
   Begin TextBox Problem 
      Height          =   285
      Left            =   1185
      TabIndex        =   44
      Top             =   600
      Width           =   6000
   End
   Begin CommandButton CloseButt 
      Caption         =   "&Continue"
      Height          =   330
      Left            =   5160
      TabIndex        =   35
      Top             =   5940
      Width           =   1620
   End
   Begin CommandButton SetButt 
      Caption         =   "Set New Values"
      Height          =   330
      Left            =   435
      TabIndex        =   34
      Top             =   5940
      Width           =   1620
   End
   Begin TextBox P10 
      Height          =   285
      Left            =   1845
      TabIndex        =   33
      Top             =   5490
      Width           =   5340
   End
   Begin TextBox P9 
      Height          =   285
      Left            =   1845
      TabIndex        =   31
      Top             =   5175
      Width           =   5340
   End
   Begin TextBox P8 
      Height          =   285
      Left            =   1845
      TabIndex        =   29
      Top             =   4860
      Width           =   5340
   End
   Begin TextBox P7 
      Height          =   285
      Left            =   1845
      TabIndex        =   27
      Top             =   4545
      Width           =   5340
   End
   Begin TextBox P6 
      Height          =   285
      Left            =   1845
      TabIndex        =   25
      Top             =   4230
      Width           =   5340
   End
   Begin TextBox P5 
      Height          =   285
      Left            =   1845
      TabIndex        =   23
      Top             =   3915
      Width           =   5340
   End
   Begin TextBox P4 
      Height          =   285
      Left            =   1845
      TabIndex        =   21
      Top             =   3600
      Width           =   5340
   End
   Begin TextBox P3 
      Height          =   285
      Left            =   1845
      TabIndex        =   19
      Top             =   3285
      Width           =   5340
   End
   Begin TextBox P2 
      Height          =   285
      Left            =   1845
      TabIndex        =   17
      Top             =   2970
      Width           =   5340
   End
   Begin TextBox P1 
      Height          =   285
      Left            =   1845
      TabIndex        =   15
      Top             =   2655
      Width           =   5340
   End
   Begin Frame FrameSysInfo 
      Caption         =   "System Info:"
      Height          =   1650
      Left            =   90
      TabIndex        =   2
      Top             =   915
      Width           =   7095
      Begin Label HD2 
         Height          =   225
         Left            =   3825
         TabIndex        =   13
         Top             =   1290
         Width           =   1650
      End
      Begin Label LabelHD2 
         Height          =   225
         Left            =   3510
         TabIndex        =   12
         Top             =   1290
         Width           =   330
      End
      Begin Label LabelDisks 
         Caption         =   "Disk Space Remaining (bytes):"
         Height          =   225
         Left            =   90
         TabIndex        =   11
         Top             =   990
         Width           =   3135
      End
      Begin Label HD1 
         Height          =   225
         Left            =   390
         TabIndex        =   10
         Top             =   1290
         Width           =   1650
      End
      Begin Label LabelHD1 
         Height          =   225
         Left            =   90
         TabIndex        =   9
         Top             =   1290
         Width           =   330
      End
      Begin Label TotalMem 
         Height          =   225
         Left            =   2325
         TabIndex        =   8
         Top             =   600
         Width           =   1065
      End
      Begin Label LabelTotalMem 
         Caption         =   "Total Memory (bytes):"
         Height          =   225
         Left            =   90
         TabIndex        =   7
         Top             =   600
         Width           =   2265
      End
      Begin Label GDIheap 
         Height          =   225
         Left            =   5805
         TabIndex        =   6
         Top             =   300
         Width           =   1065
      End
      Begin Label LabelGDIheap 
         Caption         =   "GDI Heap (% remaining):"
         Height          =   225
         Left            =   3510
         TabIndex        =   5
         Top             =   300
         Width           =   2265
      End
      Begin Label UserHeap 
         Height          =   225
         Left            =   2325
         TabIndex        =   4
         Top             =   300
         Width           =   1065
      End
      Begin Label LabelUser 
         Caption         =   "User Heap (% remaining):"
         Height          =   225
         Left            =   90
         TabIndex        =   3
         Top             =   300
         Width           =   2265
      End
   End
   Begin Label Iteration 
      Caption         =   "255"
      Height          =   225
      Left            =   4680
      TabIndex        =   36
      Top             =   315
      Width           =   2265
   End
   Begin Label LabelIter 
      Caption         =   "Iteration:"
      Height          =   225
      Left            =   3585
      TabIndex        =   38
      Top             =   315
      Width           =   1095
   End
   Begin Label Process 
      Height          =   225
      Left            =   1230
      TabIndex        =   43
      Top             =   315
      Width           =   2265
   End
   Begin Label LabelProc 
      Caption         =   "Process:"
      Height          =   225
      Left            =   120
      TabIndex        =   42
      Top             =   315
      Width           =   1095
   End
   Begin Label Routine 
      Height          =   225
      Left            =   4680
      TabIndex        =   41
      Top             =   75
      Width           =   2265
   End
   Begin Label LabelRoutine 
      Caption         =   "Routine:"
      Height          =   225
      Left            =   3585
      TabIndex        =   40
      Top             =   75
      Width           =   1095
   End
   Begin Label TheFormVariable 
      BorderStyle     =   1  'Fixed Single
      Height          =   285
      Left            =   5880
      TabIndex        =   39
      Top             =   6075
      Visible         =   0   'False
      Width           =   1350
   End
   Begin Label LabelProb 
      Caption         =   "Problem:"
      Height          =   225
      Left            =   120
      TabIndex        =   37
      Top             =   645
      Width           =   1095
   End
   Begin Label L10 
      Height          =   225
      Left            =   90
      TabIndex        =   32
      Top             =   5535
      Width           =   1695
   End
   Begin Label L9 
      Height          =   225
      Left            =   90
      TabIndex        =   30
      Top             =   5220
      Width           =   1695
   End
   Begin Label L8 
      Height          =   225
      Left            =   90
      TabIndex        =   28
      Top             =   4905
      Width           =   1695
   End
   Begin Label L7 
      Height          =   225
      Left            =   90
      TabIndex        =   26
      Top             =   4590
      Width           =   1695
   End
   Begin Label L6 
      Height          =   225
      Left            =   90
      TabIndex        =   24
      Top             =   4275
      Width           =   1695
   End
   Begin Label L5 
      Height          =   225
      Left            =   90
      TabIndex        =   22
      Top             =   3960
      Width           =   1695
   End
   Begin Label L4 
      Height          =   225
      Left            =   90
      TabIndex        =   20
      Top             =   3645
      Width           =   1695
   End
   Begin Label L3 
      Height          =   225
      Left            =   90
      TabIndex        =   18
      Top             =   3330
      Width           =   1695
   End
   Begin Label L2 
      Height          =   225
      Left            =   90
      TabIndex        =   16
      Top             =   3015
      Width           =   1695
   End
   Begin Label L1 
      Height          =   225
      Left            =   90
      TabIndex        =   14
      Top             =   2700
      Width           =   1695
   End
   Begin Label TheApplication 
      Height          =   225
      Left            =   1230
      TabIndex        =   1
      Top             =   75
      Width           =   2265
   End
   Begin Label LabelApp 
      Caption         =   "Application:"
      Height          =   225
      Left            =   120
      TabIndex        =   0
      Top             =   75
      Width           =   1095
   End
End
' ------------- Sam Spade, the Visual Basic runtime debugger -------------
' version 1.0
' 1995 KnowledgeWorks

' Used to diagnose Visual Basic runtime errors

' Writes to a log file if command line argument(s) contain "DEBUG" or "PAUSE".
' Pauses the application and shows a dialog box if command line argument(s)
' contain "PAUSE". Case is insignificant.

' The dialog box displays system information and the current values of up to
' 10 variables. The values of these variables can be reset.

' Sam Spade adds about 18K to your application.

' Requires:
'   SAMSPADE.BAS
'   SAMSPADE.FRM
'   BFVBHLPR.DLL
'   VBRUN300.DLL

' Usage:
'   Add the required files to a project and the following code to a subroutine
'   or function:
'     ~ Sam Spade, The VBasic Runtime Debugger ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'      If CONST_SPADE$ = "You Bet" Then
'        L1$ = "Variable1$": P1$ = Variable1$: L2$ = "Variable2$": P2$ = Variable2$
'        L3$ = "Variable3$": P3$ = Variable3$: L4$ = "Variable4$": P4$ = Variable4$
'        L5$ = "Variable5$": P5$ = Variable5$: L6$ = "Variable6$": P6$ = Variable6$
'        L7$ = "Variable7$": P7$ = Variable7$: L8$ = "Variable8$": P8$ = Variable8$
'        L9$ = "Variable9$": P9$ = Variable9$: L10$ = "Variable10$": P10$ = Variable10$
'        SpadeResult% = DebugLog%(theLogFileName$, themarkIt%, theApp$, theRoutine$, theProcess$, theHD1Label$, theHD2Label$, theIter%)
'        Variable1$ = P1$: Variable2$ = P2$
'        Variable3$ = P3$: Variable4$ = P4$
'        Variable5$ = P5$: Variable6$ = P6$
'        Variable7$ = P7$: Variable8$ = P8$
'        Variable9$ = P9$: Variable10$ = P10$
'        L1$ = "": L2$ = "": L3$ = "": L4$ = "": L5$ = "": L6$ = "": L7$ = "": L8$ = "": L9$ = "": L10$ = ""
'        P1$ = "": P2$ = "": P3$ = "": P4$ = "": P5$ = "": P6$ = "": P7$ = "": P8$ = "": P9$ = "": P10$ = ""
'      End If
'     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'   where:
'      L1$ through L10$   labels, usually the names of variables
'      P1$ through P10$   values
'                         * use only the number of labels and values required!
'      LogFileName$       the full path and name of the log file
'      markIt%            1 to put a line of dashes across the log as a
'                         demarcation, 0 to not mark
'      App$               name of the application being tested
'      Routine$           name of the function or subroutine being tested
'      Process$           name of the process being tested (ie. "getting data")
'      HD1Label$          the first drive whose free space to measure (ie. "C:")
'      HD2Label$          the second drive whose free space to measure (ie. "D:")
'      Iter%              the current iteration (useful if a loop is being tested)

'   Each use of the DebugLog% function makes an entry in the log. The function
'   can be used as many times as is necessary.

'   * You will need to remark out the SpadeResult% = DebugLog% line in your code if you
'     remove the SAMSPADE.* files from your project. This can be done with a search
'     and replace (ie. replace SpadeResult% = DebugLog% with 'SpadeResult% = DebugLog%)

'   example:
'   example:
'     ~ Sam Spade, The VBasic Runtime Debugger ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'      If CONST_SPADE$ = "You Bet" Then
'        L1$ = "Err": P1$ = Str$(Err): L2$ = "Fname$": P2$ = Fname$
'        SpadeResult% = DebugLog%(TedDir$ & "TED.LOG", 0, "Topic Editor Tools", "Collect", "collectFileErr", "c", Left$(Fname$, 1), 0)
'        Err = Val(P1$): Fname$ = P2$
'        L1$ = "": L2$ = ""
'        P1$ = "": P2$ = ""
'      End If
'     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

' BFVBHLPR.DLL was written by Brian Fry, who distributes it for free as
' BFVBDL.ZIP on Compuserve.

' Disclosure:
'   KnowledgeWorks provides this product as is without any representation or
'   warranty, including but not limited to the warranty of merchantability or
'   fitness for a particular purpose.

' Copyright:
'   You may use this product any way you like. Distribute it freely, either
'   in this form or compiled into your applications. No royalties or fees are
'   required, except as specified below:


' If you like Sam Spade, consider doing one or more of the following:

' - Send $10 to

'       KnowledgeWorks
'       620 Rosal Way
'       San Rafael, CA  94903-2926

'   This will help fund other useful shareware thingys and also generate
'   Very Good Karma. Send along your Email address and specify if you want to
'   be notified of any new products.

' - Send encouraging Email to
        
'       KnowledgeWorks
'       72310.2614@compuserve.com

' - Send $10 to

'       Children's Defense Fund
'       21 E Street, NW
'       Washington, DC  20001

'   or your favorite non-profit organization.

' - Stop working right now, leave your computer, find your nearest loved
'   one, tell him or her that you felt like taking a break, and ask how
'   his or her day is going.

Sub CloseButt_Click ()
    SamSpade!TheFormVariable.Caption = CONST_CLOSE
    Me.Hide
End Sub

Sub EndTheApp_Click ()
End
End Sub

Sub SetButt_Click ()
    SamSpade!TheFormVariable.Caption = CONST_SET
    Me.Hide
End Sub

