VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "ComDlg32.ocx"
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TabCtl32.ocx"
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RichTx32.ocx"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MsHFlxGD.ocx"
Begin VB.Form frmMain 
   Caption         =   "Match-n-Freq v. 6.65, a Calculus Based Program"
   ClientHeight    =   10110
   ClientLeft      =   2115
   ClientTop       =   990
   ClientWidth     =   11985
   BeginProperty Font 
      Name            =   "Arial"
      Size            =   10.5
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "main-recent-file-list.frx":0000
   LinkTopic       =   "Form1"
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   11291.24
   ScaleMode       =   0  'User
   ScaleWidth      =   14299.42
   Begin VB.PictureBox picCanvas 
      Height          =   13431
      Left            =   0
      ScaleHeight     =   12722.88
      ScaleMode       =   0  'User
      ScaleWidth      =   9821.037
      TabIndex        =   121
      TabStop         =   0   'False
      Top             =   0
      Width           =   13037
      Begin TabDlg.SSTab ODE_Tabs 
         Height          =   14700
         Left            =   360
         TabIndex        =   0
         Top             =   120
         Width           =   20550
         _ExtentX        =   36248
         _ExtentY        =   25929
         _Version        =   393216
         Style           =   1
         Tabs            =   9
         TabsPerRow      =   9
         TabHeight       =   520
         TabMaxWidth     =   2734
         TabCaption(0)   =   "&1. Start"
         TabPicture(0)   =   "main-recent-file-list.frx":030A
         Tab(0).ControlEnabled=   -1  'True
         Tab(0).Control(0)=   "lblQuestion(7)"
         Tab(0).Control(0).Enabled=   0   'False
         Tab(0).Control(1)=   "lblQuestion(6)"
         Tab(0).Control(1).Enabled=   0   'False
         Tab(0).Control(2)=   "lblQuestion(5)"
         Tab(0).Control(2).Enabled=   0   'False
         Tab(0).Control(3)=   "lblQuestion(4)"
         Tab(0).Control(3).Enabled=   0   'False
         Tab(0).Control(4)=   "lblQuestion(3)"
         Tab(0).Control(4).Enabled=   0   'False
         Tab(0).Control(5)=   "lblQuestion(2)"
         Tab(0).Control(5).Enabled=   0   'False
         Tab(0).Control(6)=   "lblQuestion(1)"
         Tab(0).Control(6).Enabled=   0   'False
         Tab(0).Control(7)=   "lblHeader1b"
         Tab(0).Control(7).Enabled=   0   'False
         Tab(0).Control(8)=   "lblHeader1a"
         Tab(0).Control(8).Enabled=   0   'False
         Tab(0).Control(9)=   "lblInstructions1"
         Tab(0).Control(9).Enabled=   0   'False
         Tab(0).Control(10)=   "freqNorm"
         Tab(0).Control(10).Enabled=   0   'False
         Tab(0).Control(11)=   "Radius"
         Tab(0).Control(11).Enabled=   0   'False
         Tab(0).Control(12)=   "holdZerosAbove"
         Tab(0).Control(12).Enabled=   0   'False
         Tab(0).Control(13)=   "GDunitFactor"
         Tab(0).Control(13).Enabled=   0   'False
         Tab(0).Control(14)=   "Tmin"
         Tab(0).Control(14).Enabled=   0   'False
         Tab(0).Control(15)=   "CMDialog1"
         Tab(0).Control(15).Enabled=   0   'False
         Tab(0).Control(16)=   "lblNote"
         Tab(0).Control(16).Enabled=   0   'False
         Tab(0).Control(17)=   "varyPZ"
         Tab(0).Control(17).Enabled=   0   'False
         Tab(0).Control(18)=   "Program(1)"
         Tab(0).Control(18).Enabled=   0   'False
         Tab(0).Control(19)=   "CDlog"
         Tab(0).Control(19).Enabled=   0   'False
         Tab(0).Control(20)=   "txtTest"
         Tab(0).Control(20).Enabled=   0   'False
         Tab(0).ControlCount=   21
         TabCaption(1)   =   "&Demos"
         TabPicture(1)   =   "main-recent-file-list.frx":0326
         Tab(1).ControlEnabled=   0   'False
         Tab(1).Control(0)=   "lblTitle"
         Tab(1).Control(1)=   "lblSentence1"
         Tab(1).Control(2)=   "lblDescription(1)"
         Tab(1).Control(3)=   "lblExTime(1)"
         Tab(1).Control(4)=   "lblDescription(2)"
         Tab(1).Control(5)=   "lblExTime(2)"
         Tab(1).Control(6)=   "lblDescription(3)"
         Tab(1).Control(7)=   "lblExTime(3)"
         Tab(1).Control(8)=   "lblDescription(4)"
         Tab(1).Control(9)=   "lblExTime(4)"
         Tab(1).Control(10)=   "lblDescription(5)"
         Tab(1).Control(11)=   "lblExTime(5)"
         Tab(1).Control(12)=   "lblDescription(6)"
         Tab(1).Control(13)=   "lblExTime(6)"
         Tab(1).Control(14)=   "lblDescription(7)"
         Tab(1).Control(15)=   "lblExTime(7)"
         Tab(1).Control(16)=   "lblDemoSection(0)"
         Tab(1).Control(17)=   "lblDemoSection(1)"
         Tab(1).Control(18)=   "lblDemoSection(2)"
         Tab(1).Control(19)=   "lblDemoSection(3)"
         Tab(1).Control(20)=   "lblDemoSection(4)"
         Tab(1).Control(21)=   "lblDescription(8)"
         Tab(1).Control(22)=   "lblFileName"
         Tab(1).Control(23)=   "lblRunTime"
         Tab(1).Control(24)=   "lblDemoHeader"
         Tab(1).Control(25)=   "cmdRunDemo"
         Tab(1).Control(26)=   "cmdCancelDemo"
         Tab(1).Control(27)=   "Exam(1)"
         Tab(1).Control(28)=   "Exam(2)"
         Tab(1).Control(29)=   "Exam(3)"
         Tab(1).Control(30)=   "Exam(4)"
         Tab(1).Control(31)=   "Exam(5)"
         Tab(1).Control(32)=   "Exam(6)"
         Tab(1).Control(33)=   "Exam(7)"
         Tab(1).Control(34)=   "Exam(8)"
         Tab(1).Control(35)=   "Exam0(1)"
         Tab(1).Control(36)=   "Exam1(1)"
         Tab(1).Control(37)=   "Exam4(1)"
         Tab(1).ControlCount=   38
         TabCaption(2)   =   "&2. Poles && Zeros"
         TabPicture(2)   =   "main-recent-file-list.frx":0342
         Tab(2).ControlEnabled=   0   'False
         Tab(2).Control(0)=   "lblnXzeros"
         Tab(2).Control(1)=   "lblnZpairs"
         Tab(2).Control(2)=   "lblnZquads"
         Tab(2).Control(3)=   "lblNote2"
         Tab(2).Control(4)=   "lblQuestion(8)"
         Tab(2).Control(5)=   "lblQuestion(9)"
         Tab(2).Control(6)=   "lblQuestion(10)"
         Tab(2).Control(7)=   "lblQuestion(11)"
         Tab(2).Control(8)=   "lblQuestion(12)"
         Tab(2).Control(9)=   "lblQuestion(13)"
         Tab(2).Control(10)=   "lblQuestion(14)"
         Tab(2).Control(11)=   "lblQuestion(15)"
         Tab(2).Control(12)=   "lblQuestion(16)"
         Tab(2).Control(13)=   "lblQuestion(17)"
         Tab(2).Control(14)=   "lblQuestion(18)"
         Tab(2).Control(15)=   "lblQuestion(19)"
         Tab(2).Control(16)=   "nAllPoles"
         Tab(2).Control(17)=   "sigmaPoles"
         Tab(2).Control(18)=   "poleReal"
         Tab(2).Control(19)=   "poleImag"
         Tab(2).Control(20)=   "chkSigmaZero"
         Tab(2).Control(21)=   "sigmaZero"
         Tab(2).Control(22)=   "chkDoublet"
         Tab(2).Control(23)=   "chkLossless"
         Tab(2).Control(24)=   "nXzeros"
         Tab(2).Control(25)=   "nZpairs"
         Tab(2).Control(26)=   "nZquads"
         Tab(2).Control(27)=   "Xzeros"
         Tab(2).Control(28)=   "Zreal"
         Tab(2).Control(29)=   "Zimag"
         Tab(2).ControlCount=   30
         TabCaption(3)   =   "&3. Misc."
         TabPicture(3)   =   "main-recent-file-list.frx":035E
         Tab(3).ControlEnabled=   0   'False
         Tab(3).Control(0)=   "lblNote3"
         Tab(3).Control(1)=   "lblKeepNotes"
         Tab(3).Control(2)=   "lblQuestion(20)"
         Tab(3).Control(3)=   "lblQuestion(21)"
         Tab(3).Control(4)=   "lblQuestion(22)"
         Tab(3).Control(5)=   "Gain"
         Tab(3).Control(6)=   "LowestX_Y"
         Tab(3).Control(7)=   "maxX_Y"
         Tab(3).Control(8)=   "Note1"
         Tab(3).Control(9)=   "Note2"
         Tab(3).ControlCount=   10
         TabCaption(4)   =   "&4. Passband Data"
         TabPicture(4)   =   "main-recent-file-list.frx":037A
         Tab(4).ControlEnabled=   0   'False
         Tab(4).Control(0)=   "PassData"
         Tab(4).Control(1)=   "txtPassCellEditor"
         Tab(4).Control(1).Enabled=   0   'False
         Tab(4).Control(2)=   "cmdClearPassData"
         Tab(4).Control(3)=   "lblArrowMovement1"
         Tab(4).ControlCount=   4
         TabCaption(5)   =   "&5. Delay Data"
         TabPicture(5)   =   "main-recent-file-list.frx":0396
         Tab(5).ControlEnabled=   0   'False
         Tab(5).Control(0)=   "txtDelayCellEditor"
         Tab(5).Control(0).Enabled=   0   'False
         Tab(5).Control(1)=   "DelayData"
         Tab(5).Control(2)=   "cmdClearDelayData"
         Tab(5).ControlCount=   3
         TabCaption(6)   =   "&6. Solver Settings"
         TabPicture(6)   =   "main-recent-file-list.frx":03B2
         Tab(6).ControlEnabled=   0   'False
         Tab(6).Control(0)=   "lblSolvQuestion(7)"
         Tab(6).Control(1)=   "lblDefAnswer(8)"
         Tab(6).Control(2)=   "lblSolvQuestion(6)"
         Tab(6).Control(3)=   "lblDefAnswer(6)"
         Tab(6).Control(4)=   "lblSolvQuestion(5)"
         Tab(6).Control(5)=   "lblDefAnswer(5)"
         Tab(6).Control(6)=   "lblSolvQuestion(4)"
         Tab(6).Control(7)=   "lblDefAnswer(4)"
         Tab(6).Control(8)=   "lblSolvQuestion(3)"
         Tab(6).Control(9)=   "lblDefAnswer(3)"
         Tab(6).Control(10)=   "lblSolvQuestion(2)"
         Tab(6).Control(11)=   "lblDefAnswer(2)"
         Tab(6).Control(12)=   "lblSolvQuestion(1)"
         Tab(6).Control(13)=   "lblDefAnswer(1)"
         Tab(6).Control(14)=   "lblInstructions4"
         Tab(6).Control(15)=   "lblHeader4b"
         Tab(6).Control(16)=   "lblHeader4a"
         Tab(6).Control(17)=   "cmdDefaultSolverData"
         Tab(6).Control(18)=   "cmdEditSolverData"
         Tab(6).Control(19)=   "Bounds"
         Tab(6).Control(20)=   "EvalMax"
         Tab(6).Control(21)=   "StepOut"
         Tab(6).Control(22)=   "StepsLim"
         Tab(6).Control(23)=   "Zero"
         Tab(6).Control(24)=   "Summary"
         Tab(6).Control(25)=   "Remax"
         Tab(6).ControlCount=   26
         TabCaption(7)   =   "&7. Run"
         TabPicture(7)   =   "main-recent-file-list.frx":03CE
         Tab(7).ControlEnabled=   0   'False
         Tab(7).Control(0)=   "AutoExit"
         Tab(7).Control(1)=   "cmdSubmit"
         Tab(7).Control(2)=   "cmdPlots"
         Tab(7).Control(3)=   "lblSubmit"
         Tab(7).Control(4)=   "lblNotes"
         Tab(7).ControlCount=   5
         TabCaption(8)   =   "&8. Tips/Suggestions"
         TabPicture(8)   =   "main-recent-file-list.frx":03EA
         Tab(8).ControlEnabled=   0   'False
         Tab(8).Control(0)=   "RichTextBox1"
         Tab(8).ControlCount=   1
         Begin VB.TextBox txtTest 
            Height          =   375
            Left            =   8760
            TabIndex        =   138
            Text            =   "Text1"
            Top             =   1440
            Visible         =   0   'False
            Width           =   2175
         End
         Begin MSComDlg.CommonDialog CDlog 
            Left            =   9240
            Top             =   720
            _ExtentX        =   847
            _ExtentY        =   847
            _Version        =   393216
         End
         Begin VB.OptionButton Program 
            Caption         =   "Version ID"
            Enabled         =   0   'False
            Height          =   255
            Index           =   1
            Left            =   240
            TabIndex        =   1
            TabStop         =   0   'False
            Top             =   1800
            Visible         =   0   'False
            Width           =   1575
         End
         Begin VB.ComboBox varyPZ 
            Height          =   360
            ItemData        =   "main-recent-file-list.frx":0406
            Left            =   240
            List            =   "main-recent-file-list.frx":0408
            TabIndex        =   2
            Text            =   "VaryPZ"
            Top             =   2280
            Width           =   2295
         End
         Begin VB.TextBox lblNote 
            BackColor       =   &H80000004&
            BorderStyle     =   0  'None
            Height          =   1215
            Left            =   2160
            MultiLine       =   -1  'True
            TabIndex        =   126
            TabStop         =   0   'False
            Text            =   "main-recent-file-list.frx":040A
            Top             =   2880
            Width           =   6375
         End
         Begin VB.CheckBox AutoExit 
            Caption         =   "Auto-exit DOSbox"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   9
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   372
            Left            =   -72120
            TabIndex        =   123
            Top             =   2040
            Value           =   1  'Checked
            Width           =   1932
         End
         Begin RichTextLib.RichTextBox RichTextBox1 
            Height          =   9345
            Left            =   -75000
            TabIndex        =   111
            Top             =   360
            Width           =   11775
            _ExtentX        =   20770
            _ExtentY        =   16484
            _Version        =   393217
            BackColor       =   -2147483626
            Enabled         =   -1  'True
            HideSelection   =   0   'False
            ReadOnly        =   -1  'True
            ScrollBars      =   2
            FileName        =   "F:\Tools.vb\Match.hz\tips.rtf"
            TextRTF         =   $"main-recent-file-list.frx":051C
         End
         Begin VB.TextBox txtDelayCellEditor 
            BorderStyle     =   0  'None
            Height          =   495
            Left            =   -66360
            MultiLine       =   -1  'True
            TabIndex        =   122
            TabStop         =   0   'False
            Top             =   840
            Visible         =   0   'False
            Width           =   1335
         End
         Begin VB.TextBox Note2 
            Height          =   372
            Left            =   -74880
            TabIndex        =   84
            Text            =   "Your notes go here"
            ToolTipText     =   "Note2...Keep notes for future runs"
            Top             =   3600
            Width           =   7100
         End
         Begin VB.TextBox Note1 
            Height          =   372
            Left            =   -74880
            TabIndex        =   83
            Text            =   "Keep notes for future runs"
            ToolTipText     =   "Note1...Keep notes for future runs"
            Top             =   3075
            Width           =   7100
         End
         Begin VB.TextBox maxX_Y 
            Height          =   372
            Left            =   -74880
            TabIndex        =   80
            Text            =   "3"
            Top             =   2160
            Width           =   1395
         End
         Begin VB.TextBox LowestX_Y 
            Height          =   372
            Left            =   -74880
            TabIndex        =   78
            Text            =   ".005"
            Top             =   1680
            Width           =   1395
         End
         Begin VB.TextBox Gain 
            Height          =   372
            Left            =   -74880
            TabIndex        =   76
            Text            =   "1"
            Top             =   1200
            Width           =   1395
         End
         Begin VB.TextBox Zimag 
            Height          =   372
            Left            =   -74880
            TabIndex        =   73
            Text            =   ".3  .6"
            Top             =   7920
            Width           =   10800
         End
         Begin VB.TextBox Zreal 
            Height          =   372
            Left            =   -74880
            TabIndex        =   71
            Text            =   "1  1"
            Top             =   7200
            Width           =   10800
         End
         Begin VB.TextBox Xzeros 
            Height          =   372
            Left            =   -74880
            TabIndex        =   69
            Text            =   "1   1.33"
            Top             =   6480
            Width           =   10800
         End
         Begin VB.TextBox nZquads 
            Height          =   372
            Left            =   -73440
            TabIndex        =   67
            Text            =   "1"
            Top             =   5640
            Width           =   311
         End
         Begin VB.TextBox nZpairs 
            Height          =   372
            Left            =   -74040
            TabIndex        =   65
            Text            =   "1"
            Top             =   5640
            Width           =   311
         End
         Begin VB.TextBox nXzeros 
            Height          =   372
            Left            =   -74640
            TabIndex        =   63
            Text            =   "2"
            Top             =   5640
            Width           =   311
         End
         Begin VB.CheckBox chkLossless 
            Caption         =   "Yes"
            Height          =   336
            Left            =   -74400
            TabIndex        =   60
            Top             =   5160
            Width           =   825
         End
         Begin VB.CheckBox chkDoublet 
            Caption         =   "Yes"
            Height          =   336
            Left            =   -74400
            TabIndex        =   58
            Top             =   4680
            Width           =   825
         End
         Begin VB.TextBox sigmaZero 
            Height          =   372
            Left            =   -74880
            TabIndex        =   56
            Top             =   4200
            Width           =   1635
         End
         Begin VB.CheckBox chkSigmaZero 
            Caption         =   "Yes"
            Height          =   372
            Left            =   -74400
            TabIndex        =   54
            Top             =   3720
            Width           =   825
         End
         Begin VB.TextBox poleImag 
            Height          =   372
            Left            =   -74880
            TabIndex        =   52
            Text            =   ".2 .3 .4 .5"
            Top             =   3240
            Width           =   10800
         End
         Begin VB.TextBox poleReal 
            Height          =   372
            Left            =   -74880
            TabIndex        =   50
            Text            =   ".4 .4 .2 .2"
            Top             =   2280
            Width           =   10800
         End
         Begin VB.TextBox sigmaPoles 
            Height          =   372
            Left            =   -74880
            TabIndex        =   48
            Text            =   ".2"
            Top             =   1320
            Width           =   1635
         End
         Begin VB.TextBox nAllPoles 
            Height          =   372
            Left            =   -74880
            TabIndex        =   46
            Text            =   "1  4"
            Top             =   840
            Width           =   1635
         End
         Begin VB.OptionButton Exam4 
            Caption         =   "ExOpt#5-All.0"
            Height          =   252
            Index           =   1
            Left            =   -74640
            TabIndex        =   124
            Top             =   4700
            Width           =   1800
         End
         Begin VB.OptionButton Exam1 
            Caption         =   "ExOpt#1-zzz.0"
            Height          =   252
            Index           =   1
            Left            =   -74640
            TabIndex        =   134
            Top             =   8300
            Width           =   1800
         End
         Begin VB.OptionButton Exam0 
            Caption         =   "ExOpt#0-JustPlots.0"
            Height          =   252
            Index           =   1
            Left            =   -74640
            TabIndex        =   135
            Top             =   9180
            Width           =   2640
         End
         Begin VB.OptionButton Exam 
            Caption         =   "ExJustDelay.1"
            Height          =   252
            Index           =   8
            Left            =   -74640
            TabIndex        =   136
            Top             =   3980
            Width           =   1800
         End
         Begin VB.OptionButton Exam 
            Caption         =   "ExZpair.1"
            Height          =   252
            Index           =   7
            Left            =   -74640
            TabIndex        =   42
            Top             =   3710
            Width           =   1800
         End
         Begin VB.OptionButton Exam 
            Caption         =   "ExDelay-Zquad.1"
            Height          =   252
            Index           =   6
            Left            =   -74640
            TabIndex        =   39
            Top             =   3430
            Width           =   2040
         End
         Begin VB.OptionButton Exam 
            Caption         =   "ExDelay-Zpair.1"
            Height          =   252
            Index           =   5
            Left            =   -74640
            TabIndex        =   36
            Top             =   3150
            Width           =   1800
         End
         Begin VB.OptionButton Exam 
            Caption         =   "Ex-Tweak-None.1"
            Height          =   252
            Index           =   4
            Left            =   -74640
            TabIndex        =   33
            Top             =   2880
            Width           =   2040
         End
         Begin VB.OptionButton Exam 
            Caption         =   "Ex-Tweak-Zeros.1"
            Height          =   252
            Index           =   3
            Left            =   -74640
            TabIndex        =   30
            Top             =   2620
            Width           =   2040
         End
         Begin VB.OptionButton Exam 
            Caption         =   "Ex-Tweak-Poles.1"
            Height          =   252
            Index           =   2
            Left            =   -74640
            TabIndex        =   27
            Top             =   2350
            Width           =   2160
         End
         Begin VB.OptionButton Exam 
            Caption         =   "Ex-Tweak-All.1"
            Height          =   252
            Index           =   1
            Left            =   -74640
            TabIndex        =   24
            Top             =   2100
            Width           =   1800
         End
         Begin VB.CommandButton cmdCancelDemo 
            Caption         =   "&Cancel"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   12
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   380
            Left            =   -68880
            TabIndex        =   18
            ToolTipText     =   "Return to main screen"
            Top             =   20
            Width           =   1700
         End
         Begin VB.CommandButton cmdRunDemo 
            Caption         =   "&Run Demo"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   12
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   380
            Left            =   -70920
            TabIndex        =   17
            ToolTipText     =   "Runs selected example in DOS"
            Top             =   20
            Width           =   1700
         End
         Begin MSComDlg.CommonDialog CMDialog1 
            Left            =   0
            Top             =   540
            _ExtentX        =   688
            _ExtentY        =   688
            _Version        =   393216
            CancelError     =   -1  'True
            DialogTitle     =   "Open an Example File for illustration"
            FontSize        =   10.2
         End
         Begin VB.TextBox Tmin 
            Height          =   372
            Left            =   360
            TabIndex        =   3
            Text            =   "76.7"
            Top             =   4200
            Width           =   912
         End
         Begin VB.TextBox GDunitFactor 
            Height          =   372
            Left            =   360
            TabIndex        =   4
            Text            =   "1e3 ns*mhz Inverse"
            ToolTipText     =   "Unit factor for Time * Freq; eg. ns*Mhz = 10^-(-9 + 6) = 10^3 = 1e3"
            Top             =   4600
            Width           =   912
         End
         Begin VB.TextBox holdZerosAbove 
            Height          =   372
            Left            =   360
            TabIndex        =   5
            Text            =   "2"
            Top             =   5100
            Width           =   912
         End
         Begin VB.TextBox Radius 
            Height          =   372
            Left            =   360
            TabIndex        =   6
            Text            =   "5"
            Top             =   5600
            Width           =   912
         End
         Begin VB.TextBox freqNorm 
            Height          =   372
            Left            =   360
            TabIndex        =   7
            Text            =   "10"
            Top             =   6000
            Width           =   912
         End
         Begin MSHierarchicalFlexGridLib.MSHFlexGrid PassData 
            Height          =   5775
            Left            =   -74880
            TabIndex        =   87
            Top             =   615
            Width           =   6690
            _ExtentX        =   11800
            _ExtentY        =   10186
            _Version        =   393216
            Rows            =   4
            Cols            =   5
            ScrollTrack     =   -1  'True
            AllowUserResizing=   3
            FormatString    =   "#|^      Frequency|^                        Yin|^                        Yout;#|1|2|3"
            DataMember      =   "mFreq data"
            RowSizingMode   =   1
            _NumberOfBands  =   1
            _Band(0).Cols   =   5
            _Band(0).GridLinesBand=   1
            _Band(0).TextStyleBand=   0
            _Band(0).TextStyleHeader=   0
            _Band(0)._NumMapCols=   4
            _Band(0)._MapCol(0)._Name=   "Frequency"
            _Band(0)._MapCol(0)._RSIndex=   1
            _Band(0)._MapCol(0)._Alignment=   4
            _Band(0)._MapCol(1)._Name=   "Yin"
            _Band(0)._MapCol(1)._RSIndex=   2
            _Band(0)._MapCol(1)._Alignment=   4
            _Band(0)._MapCol(2)._Name=   "Yout"
            _Band(0)._MapCol(2)._RSIndex=   3
            _Band(0)._MapCol(2)._Alignment=   4
            _Band(0)._MapCol(3)._Name=   "Weigth"
            _Band(0)._MapCol(3)._RSIndex=   4
            _Band(0)._MapCol(3)._Alignment=   4
         End
         Begin VB.TextBox txtPassCellEditor 
            BorderStyle     =   0  'None
            Height          =   495
            Left            =   -65640
            MultiLine       =   -1  'True
            TabIndex        =   118
            TabStop         =   0   'False
            Top             =   480
            Visible         =   0   'False
            Width           =   1335
         End
         Begin VB.CommandButton cmdClearPassData 
            Caption         =   "&Clear Columns"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   9.75
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   675
            Left            =   -67560
            TabIndex        =   88
            Top             =   960
            Width           =   1215
         End
         Begin MSHierarchicalFlexGridLib.MSHFlexGrid DelayData 
            Height          =   6015
            Left            =   -73800
            TabIndex        =   90
            Top             =   480
            Width           =   4485
            _ExtentX        =   7911
            _ExtentY        =   10610
            _Version        =   393216
            Rows            =   4
            Cols            =   3
            ScrollTrack     =   -1  'True
            AllowUserResizing=   3
            FormatString    =   "#|^             Frequency|^                    Delay (tx);#|1|2|3"
            DataMember      =   "DelFreq data"
            RowSizingMode   =   1
            _NumberOfBands  =   1
            _Band(0).Cols   =   3
            _Band(0).GridLinesBand=   1
            _Band(0).TextStyleBand=   0
            _Band(0).TextStyleHeader=   0
            _Band(0)._NumMapCols=   2
            _Band(0)._MapCol(0)._Name=   "Frequency"
            _Band(0)._MapCol(0)._RSIndex=   1
            _Band(0)._MapCol(0)._Alignment=   4
            _Band(0)._MapCol(1)._Name=   "Delay (tx)"
            _Band(0)._MapCol(1)._RSIndex=   2
            _Band(0)._MapCol(1)._Alignment=   4
         End
         Begin VB.CommandButton cmdClearDelayData 
            Caption         =   "Cle&ar Columns"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   9.75
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   675
            Left            =   -68520
            TabIndex        =   91
            Top             =   1200
            Width           =   1215
         End
         Begin VB.TextBox Remax 
            Height          =   372
            Left            =   -74760
            TabIndex        =   93
            Text            =   "22 7 15"
            ToolTipText     =   "Remax"
            Top             =   1240
            Width           =   1695
         End
         Begin VB.TextBox Summary 
            Height          =   372
            Left            =   -74778
            TabIndex        =   96
            Text            =   "0 0 0"
            ToolTipText     =   "Summary"
            Top             =   1800
            Width           =   1695
         End
         Begin VB.TextBox Zero 
            Height          =   372
            Left            =   -74760
            TabIndex        =   99
            Text            =   "1e-4 1e-5 1e-6"
            ToolTipText     =   "Zero"
            Top             =   2400
            Width           =   1695
         End
         Begin VB.TextBox StepsLim 
            Height          =   372
            Left            =   -74778
            TabIndex        =   102
            Text            =   "100"
            ToolTipText     =   "StepsLim"
            Top             =   2880
            Width           =   1695
         End
         Begin VB.TextBox StepOut 
            Height          =   372
            Left            =   -74778
            TabIndex        =   105
            Text            =   "10"
            ToolTipText     =   "StepOut"
            Top             =   3400
            Width           =   1695
         End
         Begin VB.TextBox EvalMax 
            Height          =   372
            Left            =   -74778
            TabIndex        =   108
            Text            =   "30000"
            ToolTipText     =   "EvalMax"
            Top             =   3840
            Width           =   1695
         End
         Begin VB.TextBox Bounds 
            Height          =   372
            Left            =   -74778
            TabIndex        =   112
            Text            =   ".0333 ???"
            ToolTipText     =   "Bounds"
            Top             =   4860
            Width           =   1695
         End
         Begin VB.CommandButton cmdEditSolverData 
            Caption         =   "&Edit Defaults"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   12
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   480
            Left            =   -72120
            TabIndex        =   127
            ToolTipText     =   "Enters default values for editing"
            Top             =   5640
            Width           =   2000
         End
         Begin VB.CommandButton cmdDefaultSolverData 
            Caption         =   "&Use Defaults"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   12
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   480
            Left            =   -69720
            TabIndex        =   128
            ToolTipText     =   "Sets all values to blank"
            Top             =   5640
            Width           =   2000
         End
         Begin VB.CommandButton cmdSubmit 
            Caption         =   "Submit a &Run"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   12
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   720
            Left            =   -72120
            TabIndex        =   116
            ToolTipText     =   "Run Match-n-Freq in DOS with your Input file"
            Top             =   2520
            Width           =   1692
         End
         Begin VB.CommandButton cmdPlots 
            Caption         =   "View Past &Plots"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   12
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   720
            Left            =   -68040
            TabIndex        =   117
            ToolTipText     =   "Execute Plots.exe"
            Top             =   2520
            Width           =   1600
         End
         Begin VB.Label lblQuestion 
            AutoSize        =   -1  'True
            Caption         =   "13. » Max. |Y| (Real part) parameter values for Poles?"
            Height          =   240
            Index           =   22
            Left            =   -73320
            TabIndex        =   81
            Top             =   2220
            Width           =   5070
         End
         Begin VB.Label lblQuestion 
            Caption         =   "12. » Lowest |Y| (sigma) value for Poles && Zeros?"
            Height          =   240
            Index           =   21
            Left            =   -73320
            TabIndex        =   79
            Top             =   1740
            Width           =   8340
         End
         Begin VB.Label lblQuestion 
            AutoSize        =   -1  'True
            Caption         =   "11. » Gain value?"
            Height          =   240
            Index           =   20
            Left            =   -73320
            TabIndex        =   77
            Top             =   1260
            Width           =   1680
         End
         Begin VB.Label lblKeepNotes 
            AutoSize        =   -1  'True
            Caption         =   "20. » Keep notes below ..."
            Height          =   240
            Left            =   -74880
            TabIndex        =   82
            Top             =   2760
            Width           =   2760
         End
         Begin VB.Label lblNote3 
            AutoSize        =   -1  'True
            BackColor       =   &H00FFFFFF&
            Caption         =   " === Below here, location values must be normalized by X or Y-axis Norm value! === "
            Height          =   240
            Left            =   -74880
            TabIndex        =   75
            Top             =   720
            Width           =   8808
         End
         Begin VB.Label lblQuestion 
            AutoSize        =   -1  'True
            Caption         =   "10c. »                            ... imag values?"
            Height          =   240
            Index           =   19
            Left            =   -74880
            TabIndex        =   74
            Top             =   7560
            Width           =   3750
         End
         Begin VB.Label lblQuestion 
            AutoSize        =   -1  'True
            Caption         =   "10b. » Zero pairs && quads ... real values?"
            Height          =   240
            Index           =   18
            Left            =   -74880
            TabIndex        =   72
            Top             =   6840
            Width           =   3915
         End
         Begin VB.Label lblQuestion 
            AutoSize        =   -1  'True
            Caption         =   "10a. » Xzeros...Omega-axis zero, (Imaginary) value (>= 1.0)?"
            Height          =   240
            Index           =   17
            Left            =   -74880
            TabIndex        =   70
            Top             =   6120
            Width           =   5745
         End
         Begin VB.Label lblQuestion 
            Caption         =   "10. » Number of Zero types; i.e. S. omega axis, P. pairs && Q. quads?"
            Height          =   240
            Index           =   16
            Left            =   -73080
            TabIndex        =   68
            Top             =   5640
            Width           =   7155
            WordWrap        =   -1  'True
         End
         Begin VB.Label lblQuestion 
            AutoSize        =   -1  'True
            Caption         =   "9c. » Is Sigma Zero 'Lossless'?"
            Height          =   240
            Index           =   15
            Left            =   -73080
            TabIndex        =   61
            Top             =   5160
            Width           =   2910
         End
         Begin VB.Label lblQuestion 
            AutoSize        =   -1  'True
            Caption         =   "9b. » Is Sigma Zero a 'Doublet'?"
            Height          =   240
            Index           =   14
            Left            =   -73080
            TabIndex        =   59
            Top             =   4680
            Width           =   3015
         End
         Begin VB.Label lblQuestion 
            AutoSize        =   -1  'True
            Caption         =   "9a. » Sigma Zero -initial- value?"
            Height          =   240
            Index           =   13
            Left            =   -73080
            TabIndex        =   57
            Top             =   4200
            Width           =   3000
         End
         Begin VB.Label lblQuestion 
            AutoSize        =   -1  'True
            Caption         =   "9. » Want a -Zero- on the Sigma-axis?"
            Height          =   240
            Index           =   12
            Left            =   -73080
            TabIndex        =   55
            Top             =   3720
            Width           =   3600
         End
         Begin VB.Label lblQuestion 
            AutoSize        =   -1  'True
            Caption         =   "8c. »              ... IMAGINARY values?"
            Height          =   240
            Index           =   11
            Left            =   -74880
            TabIndex        =   53
            Top             =   2760
            Width           =   3450
         End
         Begin VB.Label lblQuestion 
            AutoSize        =   -1  'True
            Caption         =   "8b. » Pole pairs ... REAL values?"
            Height          =   240
            Index           =   10
            Left            =   -74880
            TabIndex        =   51
            Top             =   1800
            Width           =   3120
         End
         Begin VB.Label lblQuestion 
            AutoSize        =   -1  'True
            Caption         =   "8a. » Sigma-axis Pole, REAL value?"
            Height          =   240
            Index           =   9
            Left            =   -72960
            TabIndex        =   49
            Top             =   1380
            Width           =   3390
         End
         Begin VB.Label lblQuestion 
            AutoSize        =   -1  'True
            Caption         =   "8. » No. of Poles on Sigma axis -and- pairs; e.g. 0 4 => 0 Sigma + 4 pairs?"
            Height          =   240
            Index           =   8
            Left            =   -72960
            TabIndex        =   47
            Top             =   960
            Width           =   6990
         End
         Begin VB.Label lblNote2 
            AutoSize        =   -1  'True
            BackColor       =   &H00FFFFFF&
            Caption         =   " === Below here, location values must be normalized by X or Y-axis Norm value! === "
            Height          =   240
            Left            =   -74880
            TabIndex        =   45
            Top             =   480
            Width           =   8808
         End
         Begin VB.Label lblnZquads 
            AutoSize        =   -1  'True
            Caption         =   "Q:"
            Height          =   240
            Left            =   -73680
            TabIndex        =   66
            Top             =   5640
            Width           =   255
         End
         Begin VB.Label lblnZpairs 
            AutoSize        =   -1  'True
            Caption         =   "P:"
            Height          =   240
            Left            =   -74280
            TabIndex        =   64
            Top             =   5640
            Width           =   255
         End
         Begin VB.Label lblnXzeros 
            AutoSize        =   -1  'True
            Caption         =   "S:"
            Height          =   240
            Left            =   -74880
            TabIndex        =   62
            Top             =   5640
            Width           =   255
         End
         Begin VB.Label lblDemoHeader 
            AutoSize        =   -1  'True
            Caption         =   "Match n Freq™ problem with ..."
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   11.25
               Charset         =   0
               Weight          =   400
               Underline       =   -1  'True
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   270
            Left            =   -71040
            TabIndex        =   23
            Top             =   1680
            Width           =   4335
         End
         Begin VB.Label lblRunTime 
            AutoSize        =   -1  'True
            Caption         =   "Run Time (Seconds)"
            Height          =   450
            Left            =   -72840
            TabIndex        =   22
            Top             =   1680
            Width           =   1320
            WordWrap        =   -1  'True
         End
         Begin VB.Label lblFileName 
            AutoSize        =   -1  'True
            Caption         =   "File Name"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   11.25
               Charset         =   0
               Weight          =   400
               Underline       =   -1  'True
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   -74205
            TabIndex        =   21
            Top             =   1680
            Width           =   1110
         End
         Begin VB.Label lblDescription 
            Caption         =   "GroupDelay Only; see how pole locations move just on delay data."
            Height          =   372
            Index           =   8
            Left            =   -71655
            TabIndex        =   85
            Top             =   3980
            Width           =   7000
         End
         Begin VB.Label lblDemoSection 
            Caption         =   "------- Opt #5: varies -All- Pole && Zero locations ---------------"
            Height          =   375
            Index           =   4
            Left            =   -73230
            TabIndex        =   129
            Top             =   4440
            Width           =   5865
         End
         Begin VB.Label lblDemoSection 
            Caption         =   "------- Opt #4: varies -Only- Pole Locations ---------------------"
            Height          =   375
            Index           =   3
            Left            =   -73230
            TabIndex        =   130
            Top             =   6600
            Width           =   5865
         End
         Begin VB.Label lblDemoSection 
            Caption         =   "------- Opt #3: varies -Only- Zero locations ----------------------"
            Height          =   375
            Index           =   2
            Left            =   -73230
            TabIndex        =   131
            Top             =   7400
            Width           =   5865
         End
         Begin VB.Label lblDemoSection 
            Caption         =   "------- Opt #1: varies -Only- Omega-axis Zeros -----------------"
            Height          =   375
            Index           =   1
            Left            =   -73230
            TabIndex        =   132
            Top             =   8000
            Width           =   7005
         End
         Begin VB.Label lblDemoSection 
            Caption         =   "------- Opt #0: Plots only ... no variables changed  -------------"
            Height          =   375
            Index           =   0
            Left            =   -73230
            TabIndex        =   133
            Top             =   8700
            Width           =   5865
         End
         Begin VB.Label lblExTime 
            Alignment       =   1  'Right Justify
            AutoSize        =   -1  'True
            Caption         =   "510"
            Height          =   255
            Index           =   7
            Left            =   -72480
            TabIndex        =   43
            Top             =   3705
            Width           =   390
         End
         Begin VB.Label lblDescription 
            AutoSize        =   -1  'True
            Caption         =   "zzz"
            Height          =   240
            Index           =   7
            Left            =   -71655
            TabIndex        =   44
            Top             =   3710
            Width           =   270
         End
         Begin VB.Label lblExTime 
            Alignment       =   1  'Right Justify
            AutoSize        =   -1  'True
            Caption         =   "55"
            Height          =   255
            Index           =   6
            Left            =   -72360
            TabIndex        =   40
            Top             =   3430
            Width           =   270
         End
         Begin VB.Label lblDescription 
            AutoSize        =   -1  'True
            Caption         =   "3 ==> Tweak All Zeros ... Zero Quad"
            Height          =   240
            Index           =   6
            Left            =   -71655
            TabIndex        =   41
            Top             =   3435
            Width           =   3420
         End
         Begin VB.Label lblExTime 
            Alignment       =   1  'Right Justify
            AutoSize        =   -1  'True
            Caption         =   "140"
            Height          =   255
            Index           =   5
            Left            =   -72360
            TabIndex        =   37
            Top             =   3150
            Width           =   270
         End
         Begin VB.Label lblDescription 
            AutoSize        =   -1  'True
            Caption         =   "3 ==> Tweak All Zeros ... Zero Pair"
            Height          =   240
            Index           =   5
            Left            =   -71655
            TabIndex        =   38
            Top             =   3150
            Width           =   3270
         End
         Begin VB.Label lblExTime 
            Alignment       =   1  'Right Justify
            AutoSize        =   -1  'True
            Caption         =   "170"
            Height          =   255
            Index           =   4
            Left            =   -72360
            TabIndex        =   34
            Top             =   2880
            Width           =   270
         End
         Begin VB.Label lblDescription 
            AutoSize        =   -1  'True
            Caption         =   "0 ==> Tweak None ... no poles && no zeros; used just for ploting"
            Height          =   240
            Index           =   4
            Left            =   -71655
            TabIndex        =   35
            Top             =   2880
            Width           =   6150
         End
         Begin VB.Label lblExTime 
            Alignment       =   1  'Right Justify
            AutoSize        =   -1  'True
            Caption         =   "170"
            Height          =   255
            Index           =   3
            Left            =   -72360
            TabIndex        =   31
            Top             =   2620
            Width           =   270
         End
         Begin VB.Label lblDescription 
            AutoSize        =   -1  'True
            Caption         =   "3 ==> Tweak Zeros only"
            Height          =   240
            Index           =   3
            Left            =   -71655
            TabIndex        =   32
            Top             =   2625
            Width           =   2265
         End
         Begin VB.Label lblExTime 
            Alignment       =   1  'Right Justify
            AutoSize        =   -1  'True
            Caption         =   "55"
            Height          =   255
            Index           =   2
            Left            =   -72360
            TabIndex        =   28
            Top             =   2350
            Width           =   270
         End
         Begin VB.Label lblDescription 
            AutoSize        =   -1  'True
            Caption         =   "4 ==> Tweak Poles only"
            Height          =   240
            Index           =   2
            Left            =   -71655
            TabIndex        =   29
            Top             =   2355
            Width           =   2250
         End
         Begin VB.Label lblExTime 
            Alignment       =   1  'Right Justify
            AutoSize        =   -1  'True
            Caption         =   "550"
            Height          =   255
            Index           =   1
            Left            =   -72360
            TabIndex        =   25
            Top             =   2100
            Width           =   270
         End
         Begin VB.Label lblDescription 
            AutoSize        =   -1  'True
            Caption         =   "5 ==> Tweak All Poles && Zeros for an Optimal H(s) fit && flat Delay"
            Height          =   240
            Index           =   1
            Left            =   -71655
            TabIndex        =   26
            Top             =   2100
            Width           =   6090
         End
         Begin VB.Label lblSentence1 
            AutoSize        =   -1  'True
            Caption         =   $"main-recent-file-list.frx":1DFE
            ForeColor       =   &H00FF0000&
            Height          =   720
            Left            =   -74280
            TabIndex        =   20
            Top             =   840
            Width           =   9975
            WordWrap        =   -1  'True
         End
         Begin VB.Label lblTitle 
            Alignment       =   2  'Center
            AutoSize        =   -1  'True
            Caption         =   "Match n Freq™ v. 6.65 Demos"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   18
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   405
            Left            =   -71340
            TabIndex        =   19
            Top             =   480
            Width           =   4320
         End
         Begin VB.Label lblInstructions1 
            Alignment       =   2  'Center
            AutoSize        =   -1  'True
            Caption         =   $"main-recent-file-list.frx":1F34
            ForeColor       =   &H00FF000D&
            Height          =   720
            Left            =   2160
            TabIndex        =   8
            Top             =   600
            Width           =   6000
            WordWrap        =   -1  'True
         End
         Begin VB.Label lblHeader1a 
            Alignment       =   2  'Center
            AutoSize        =   -1  'True
            Caption         =   "Responses"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   10.5
               Charset         =   0
               Weight          =   400
               Underline       =   -1  'True
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   300
            Left            =   600
            TabIndex        =   9
            Top             =   1440
            Width           =   1452
            WordWrap        =   -1  'True
         End
         Begin VB.Label lblHeader1b 
            Alignment       =   2  'Center
            AutoSize        =   -1  'True
            Caption         =   "Questions"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   10.5
               Charset         =   0
               Weight          =   400
               Underline       =   -1  'True
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   300
            Left            =   2700
            TabIndex        =   10
            Top             =   1440
            Width           =   3396
            WordWrap        =   -1  'True
         End
         Begin VB.Label lblQuestion 
            AutoSize        =   -1  'True
            Caption         =   "1. » 1-> saves version number of Match-n-Freq App."
            Enabled         =   0   'False
            Height          =   240
            Index           =   1
            Left            =   2830
            TabIndex        =   137
            Top             =   1695
            Visible         =   0   'False
            Width           =   5865
            WordWrap        =   -1  'True
         End
         Begin VB.Label lblQuestion 
            Alignment       =   1  'Right Justify
            AutoSize        =   -1  'True
            Caption         =   "2. » 0->No tweaking, 1->Sidelobe Equalize Ripple, 3->Zeros Only, 4->Poles Only, and     5->Both Poles && Zeros"
            Height          =   480
            Index           =   2
            Left            =   2760
            TabIndex        =   11
            Top             =   2295
            Width           =   6345
            WordWrap        =   -1  'True
         End
         Begin VB.Label lblQuestion 
            Caption         =   "3. » Desire a specific group delay value, Tmin?  If not, enter a '0' for a Tmin value."
            Height          =   240
            Index           =   3
            Left            =   1320
            TabIndex        =   12
            Top             =   4305
            Width           =   8850
            WordWrap        =   -1  'True
         End
         Begin VB.Label lblQuestion 
            Caption         =   "4. » Constant to balance, group delay, Tmin && tx (see Delay Data Tab) values; default = 1?"""
            Height          =   240
            Index           =   4
            Left            =   1320
            TabIndex        =   13
            ToolTipText     =   "Unit factor of Time * Frequency Inverse"
            Top             =   4695
            Width           =   9525
         End
         Begin VB.Label lblQuestion 
            Caption         =   "5. » Lower Bound for |zero| sigma values; default = 20+% of Freq Norm (below)?"
            Height          =   480
            Index           =   5
            Left            =   1320
            TabIndex        =   14
            ToolTipText     =   "Reasonable lower bound for Zeros absolute Sigma value."
            Top             =   5200
            Width           =   8940
         End
         Begin VB.Label lblQuestion 
            Caption         =   "6. » 'Radius' value: radius from origin to contain All your Poles; default = 50+% of 'Freq Norm'?"
            Height          =   240
            Index           =   6
            Left            =   1320
            TabIndex        =   15
            ToolTipText     =   "4 starters go large value to give Poles room to find 'nice' locations.  Drop radius as Zeros are added for Group Delay."
            Top             =   5640
            Width           =   8940
         End
         Begin VB.Label lblQuestion 
            AutoSize        =   -1  'True
            Caption         =   "7. » Freq Norm value: upper passband Frequency limit && 1st sidelobe zero location?"
            Height          =   240
            Index           =   7
            Left            =   1320
            TabIndex        =   16
            Top             =   6000
            Width           =   9480
            WordWrap        =   -1  'True
         End
         Begin VB.Label lblArrowMovement1 
            Caption         =   "Use Enter or Tab key to move between columns and Left, Right, Up && Down Arrow keys to enter/edit X && Y data values."
            ForeColor       =   &H00FF0000&
            Height          =   2400
            Left            =   -67800
            TabIndex        =   89
            Top             =   2052
            Width           =   2268
         End
         Begin VB.Label lblHeader4a 
            Alignment       =   2  'Center
            AutoSize        =   -1  'True
            Caption         =   "Default Values"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   10.5
               Charset         =   0
               Weight          =   400
               Underline       =   -1  'True
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   240
            Left            =   -73440
            TabIndex        =   119
            Top             =   888
            Width           =   1752
         End
         Begin VB.Label lblHeader4b 
            Alignment       =   2  'Center
            AutoSize        =   -1  'True
            Caption         =   "Control Questions"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   10.5
               Charset         =   0
               Weight          =   400
               Underline       =   -1  'True
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   240
            Left            =   -70695
            TabIndex        =   120
            Top             =   880
            Width           =   2310
            WordWrap        =   -1  'True
         End
         Begin VB.Label lblInstructions4 
            Alignment       =   2  'Center
            AutoSize        =   -1  'True
            Caption         =   "For a definition of the following Solver control variables read the 'Manual.rtf' file."
            ForeColor       =   &H00FF0000&
            Height          =   240
            Left            =   -74160
            TabIndex        =   92
            Top             =   600
            Width           =   8745
         End
         Begin VB.Label lblDefAnswer 
            AutoSize        =   -1  'True
            Caption         =   "22 7 15"
            Height          =   240
            Index           =   1
            Left            =   -72840
            TabIndex        =   94
            Top             =   1230
            Width           =   720
         End
         Begin VB.Label lblSolvQuestion 
            Caption         =   $"main-recent-file-list.frx":1FBB
            Height          =   480
            Index           =   1
            Left            =   -71520
            TabIndex        =   95
            Top             =   1200
            Width           =   7305
            WordWrap        =   -1  'True
         End
         Begin VB.Label lblDefAnswer 
            AutoSize        =   -1  'True
            Caption         =   "0  0  0"
            Height          =   255
            Index           =   2
            Left            =   -72840
            TabIndex        =   97
            Top             =   1830
            Width           =   735
         End
         Begin VB.Label lblSolvQuestion 
            AutoSize        =   -1  'True
            Caption         =   "2. »  SUMMARY: a Summary report (for each solver)"
            Height          =   240
            Index           =   2
            Left            =   -71520
            TabIndex        =   98
            Top             =   1830
            Width           =   4935
         End
         Begin VB.Label lblDefAnswer 
            AutoSize        =   -1  'True
            Caption         =   "1e-4 1e-5 1e-6"
            Height          =   240
            Index           =   3
            Left            =   -73080
            TabIndex        =   100
            Top             =   2400
            Width           =   1425
         End
         Begin VB.Label lblSolvQuestion 
            AutoSize        =   -1  'True
            Caption         =   "3. » ZERO: Iteration convergent tolerance (for each solver)"
            Height          =   240
            Index           =   3
            Left            =   -71520
            TabIndex        =   101
            Top             =   2400
            Width           =   6885
         End
         Begin VB.Label lblDefAnswer 
            AutoSize        =   -1  'True
            Caption         =   "100"
            Height          =   255
            Index           =   4
            Left            =   -72660
            TabIndex        =   103
            Top             =   2880
            Width           =   495
         End
         Begin VB.Label lblSolvQuestion 
            AutoSize        =   -1  'True
            Caption         =   "4. » STEPLIMS: Limit # of steps per iteration (for Outer solver, Jupiter)."
            Height          =   240
            Index           =   4
            Left            =   -71520
            TabIndex        =   104
            Top             =   2910
            Width           =   6675
         End
         Begin VB.Label lblDefAnswer 
            AutoSize        =   -1  'True
            Caption         =   "10"
            Height          =   255
            Index           =   5
            Left            =   -72600
            TabIndex        =   106
            Top             =   3390
            Width           =   255
         End
         Begin VB.Label lblSolvQuestion 
            AutoSize        =   -1  'True
            Caption         =   "5. » STEPOUT: Provides snapshot prints every N steps"
            Height          =   240
            Index           =   5
            Left            =   -71520
            TabIndex        =   107
            Top             =   3360
            Width           =   5565
         End
         Begin VB.Label lblDefAnswer 
            AutoSize        =   -1  'True
            Caption         =   "30000"
            Height          =   252
            Index           =   6
            Left            =   -72700
            TabIndex        =   109
            Top             =   3840
            Width           =   612
         End
         Begin VB.Label lblSolvQuestion 
            AutoSize        =   -1  'True
            Caption         =   "6. » EVALMAX: Limit total # of model evaluations"
            Height          =   240
            Index           =   6
            Left            =   -71520
            TabIndex        =   110
            Top             =   3840
            Width           =   4935
         End
         Begin VB.Label lblDefAnswer 
            AutoSize        =   -1  'True
            Caption         =   ".0333 .333 ... .555"
            Height          =   240
            Index           =   8
            Left            =   -73080
            TabIndex        =   113
            Top             =   4920
            Width           =   1740
         End
         Begin VB.Label lblSolvQuestion 
            AutoSize        =   -1  'True
            Caption         =   "7. » BOUNDS: Limit Xzeros && Peak Location step size; careful to step slowly."
            Height          =   480
            Index           =   7
            Left            =   -71160
            TabIndex        =   114
            Top             =   4905
            Width           =   6420
            WordWrap        =   -1  'True
         End
         Begin VB.Label lblSubmit 
            Alignment       =   2  'Center
            AutoSize        =   -1  'True
            Caption         =   "'Submit' will run a DOS program using the DOSbox program.  Please remember to exit DOSbox by typing  EXIT  !!!"
            ForeColor       =   &H00FF0000&
            Height          =   612
            Left            =   -73092
            TabIndex        =   115
            Top             =   1200
            Width           =   7044
            WordWrap        =   -1  'True
         End
         Begin VB.Label lblNotes 
            Caption         =   $"main-recent-file-list.frx":205A
            Height          =   1332
            Left            =   -73080
            TabIndex        =   86
            Top             =   4080
            Width           =   7692
         End
      End
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   $"main-recent-file-list.frx":2177
      ForeColor       =   &H00FF000D&
      Height          =   720
      Left            =   0
      TabIndex        =   125
      Top             =   0
      Width           =   6000
      WordWrap        =   -1  'True
   End
   Begin VB.Menu mnuOpen 
      Caption         =   "Recent Files "
      Begin VB.Menu mnuSep 
         Caption         =   ""
         Checked         =   -1  'True
      End
      Begin VB.Menu mnuRegFile 
         Caption         =   ""
         Index           =   1
         Visible         =   0   'False
      End
      Begin VB.Menu mnuRegFile 
         Caption         =   ""
         Index           =   2
         Visible         =   0   'False
      End
      Begin VB.Menu mnuRegFile 
         Caption         =   ""
         Index           =   3
         Visible         =   0   'False
      End
      Begin VB.Menu mnuRegFile 
         Caption         =   ""
         Index           =   4
         Visible         =   0   'False
      End
      Begin VB.Menu mnuSep2 
         Caption         =   ""
      End
      Begin VB.Menu mnuFileNew 
         Caption         =   "&New"
         Shortcut        =   ^N
      End
      Begin VB.Menu mnuFileOpen 
         Caption         =   "&Open ..."
         Shortcut        =   ^O
      End
      Begin VB.Menu mnuFileSave 
         Caption         =   "&Save"
         Shortcut        =   ^S
      End
      Begin VB.Menu mnuFileSaveAs 
         Caption         =   "Save &As ..."
         Shortcut        =   ^A
      End
      Begin VB.Menu mnuFileDelete 
         Caption         =   "Delete ..."
      End
      Begin VB.Menu mnuFileSeperater 
         Caption         =   "-"
      End
      Begin VB.Menu mnuFileSubmit 
         Caption         =   "Submit &Run"
         Shortcut        =   ^R
      End
      Begin VB.Menu mnuFileSeperater2 
         Caption         =   "-"
      End
      Begin VB.Menu mnuFileExit 
         Caption         =   "Exit"
      End
   End
   Begin VB.Menu mnuDemos 
      Caption         =   "Demos"
      Begin VB.Menu mnuDemosRun 
         Caption         =   "Run D&emo ..."
         Shortcut        =   ^D
      End
   End
   Begin VB.Menu mnuView 
      Caption         =   "View"
      Begin VB.Menu mnuViewDemos 
         Caption         =   "&Example File ..."
      End
      Begin VB.Menu mnuViewOutput 
         Caption         =   "&Last Output ..."
         Shortcut        =   ^L
      End
      Begin VB.Menu mnuViewPlots 
         Caption         =   "&Plots ..."
         Shortcut        =   ^P
      End
   End
   Begin VB.Menu mnuWeb 
      Caption         =   "Web Links"
      Begin VB.Menu mnuWebPres 
         Caption         =   "Manufacturing Presentation"
      End
      Begin VB.Menu mnuWebVideo 
         Caption         =   "Web Slides ... how to use this App"
      End
      Begin VB.Menu mnuWebLinkEd 
         Caption         =   "notePad++ Code Editor, we recommand it."
      End
      Begin VB.Menu mnuWebLinkBar5 
         Caption         =   "-"
      End
      Begin VB.Menu mnuWebLink4 
         Caption         =   "Parameter 'Tweaking' Textbook Website"
      End
      Begin VB.Menu mnuWebLinkBar 
         Caption         =   "-"
      End
      Begin VB.Menu mnuWebLinkComp 
         Caption         =   "FC-Compiler (Alpha version)"
      End
      Begin VB.Menu mnuWebLinkBar3 
         Caption         =   "-"
      End
      Begin VB.Menu mnuWebLink 
         Caption         =   "Magnetic Recording Article"
      End
      Begin VB.Menu mnuWebLink2 
         Caption         =   "Filter Design Article"
      End
      Begin VB.Menu mnuWebLink3 
         Caption         =   "Pulse Slimming Article"
      End
      Begin VB.Menu mnuWebLinkBar4 
         Caption         =   "-"
      End
      Begin VB.Menu mnuWebLinkApp 
         Caption         =   "Other (Calculus-level) Apps"
         Begin VB.Menu mnuWebLinkC 
            Caption         =   "CurvFit™: fit curve to data"
         End
         Begin VB.Menu mnuWebLinkR 
            Caption         =   "Robot4™: move A to B"
         End
      End
      Begin VB.Menu mnuWebLinkApp2 
         Caption         =   "Other Apps"
         Begin VB.Menu mnuWebLinkS 
            Caption         =   "SpectrumSolvers™"
         End
      End
   End
   Begin VB.Menu mnuHelp 
      Caption         =   "Help"
      Begin VB.Menu mnuHelpManual 
         Caption         =   "&Manual ..."
      End
      Begin VB.Menu mnuHelpVideos 
         Caption         =   "Video Apps for Classes (web)"
      End
      Begin VB.Menu mnuHelpEmail 
         Caption         =   "&E-mail Support ..."
      End
      Begin VB.Menu mnuHelpForum 
         Caption         =   "Create, Collaborative, && Help Train ..."
      End
      Begin VB.Menu mnuHelpPrayer 
         Caption         =   "Prayer Tree ..."
      End
      Begin VB.Menu mnuHelpDonate 
         Caption         =   "Donate ..."
      End
      Begin VB.Menu mnuHelpAbout 
         Caption         =   "&About ..."
      End
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'Dim i As Integer
Dim temp As String
Dim blnOnList As Boolean

'Private Const WM_HSCROLL = &H114
Private Const WM_VSCROLL = &H115

' Scroll Bar Commands
Private Const SB_LINEUP = 0
'Private Const SB_LINELEFT = 0
Private Const SB_LINEDOWN = 1
'Private Const SB_LINERIGHT = 1
'Private Const SB_PAGEUP = 1 '2
'Private Const SB_PAGELEFT = 2
'Private Const SB_PAGEDOWN = 1 '3
'Private Const SB_PAGERIGHT = 3
'Private Const SB_THUMBPOSITION = 4
'Private Const SB_THUMBTRACK = 5
'Private Const SB_TOP = 6
'Private Const SB_LEFT = 6
'Private Const SB_BOTTOM = 7
'Private Const SB_RIGHT = 7
'Private Const SB_ENDSCROLL = 8

  Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd _
    As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
  Private Declare Function ShellExecute Lib _
        "shell32.dll" Alias "ShellExecuteA" _
        (ByVal hwnd As Long, _
        ByVal lpOperation As String, _
        ByVal lpFile As String, _
        ByVal lpParameters As String, _
        ByVal lpDirectory As String, _
        ByVal nShowCmd As Long) As Long

' size of scrollbars in twips
Private Const SB_Width = 0
Private Const SB_Height = 0

Private WithEvents grid As MSHFlexGrid
Attribute grid.VB_VarHelpID = -1
' These 'cell' variables keep track of the cell that was active
' when edit mode was entered.
Dim cellRow As Long, cellCol As Long
Dim cellRowDelay As Long, cellColDelay As Long
Dim cellRowPass As Long, cellColPass As Long
Private i As Integer
Private Num As Integer
Private nPoles As Integer
Private prntCntls() As cntlInfo
Private restore As Boolean
Private tmp As String
Private tmp2 As String
Private UsingMouse As Boolean  ' Flag for using the Mouse in the Grid.
Private words() As String


Private Type cntlInfo
      blnIsArray As Boolean
      lngIndex As Long
      strName As String
      blntabStop As Boolean
End Type

Private Sub cmdCancelDemo_Click()
      Call setTabs(True):    fileDemo = "":     ODE_Tabs.TabVisible(0) = True
      ODE_Tabs.Tab = 0
End Sub
Private Sub cmdClearPassData_Click()
      Set grid = PassData:     ClearGrid
      txtPassCellEditor.Text = "":  cellRowPass = 1:   cellColPass = 1
      cellRow = cellRowPass:    cellCol = cellColPass
      Call ShowCellEditor(txtPassCellEditor)
End Sub
Private Sub cmdClearDelayData_Click()
      Set grid = DelayData:     ClearGrid
      txtDelayCellEditor.Text = "":  cellRowDelay = 1:   cellColDelay = 1
      cellRow = cellRowDelay:    cellCol = cellColDelay
      Call ShowCellEditor(txtDelayCellEditor)
End Sub
Private Sub cmdDefaultSolverData_Click()
      Call clearSolvdata
      Call SolvEnabled(False)
End Sub
Private Sub cmdEditSolverData_Click()
      Remax = "15  22  15":      Summary = "1   0   0":    Zero = "1e-5 1e-5 1e-6"
      StepsLim = "100":        StepOut = "10":          EvalMax = "30000"
      Bounds = ".0123 ??? .777"
      Call SolvEnabled(True)
End Sub
Private Sub cmdPlots_Click()
      Call viewPlots
'        Shell installPath & "\ODE-XYplots.exe ", vbNormalFocus
End Sub
Private Sub cmdRunDemo_Click()
      fileTemp = fileDemo:  fileTempPath = App.path & "\demos"
'      Call prepare2exit    isdirty?
      demo = "Demo":    Call FileRun: '  Call setTabs(True)
End Sub
Private Sub cmdSubmit_Click()
      If Not isCompleteTest Then
         Call setTabs(True):  Exit Sub
      End If
      For i = 1 To mQuestions
        lblQuestion(i).ForeColor = vbInfoText
      Next i
      Dim exitHere As Integer, exitMe As Integer
      exitHere = 0
      For i = 1 To 5
        Call checkArraySize(i, exitMe):   exitHere = exitHere + exitMe:  exitMe = 0
      Next i
      If exitHere > 0 Then Exit Sub
      demo = "*":     Call FileRun:     Call setTabs(True)
End Sub
Private Sub checkArraySize(code, exitMe)
    Dim nbox As String, last As Integer
    Dim box1 As String, box2 As String
'    With mdlCommonFiles
      If code = 1 Then
' nPoles ==> n 'poleReal' and n 'poleImag
        Num = WordCount(nAllPoles, last):  nbox = "nAllPoles"
        box1 = "poleReal":  box2 = ""
        If Num > WordCount(poleReal, last) Then
          Call mdlCommonFiles.checkArraySize2(code, Num, nbox, box1, box2)
          poleReal = FixCount(poleReal, last):   exitMe = 1
        End If
      ElseIf code = 2 Then
' nXzeros & Xzeros
        Num = nXzeros:  nbox = "nXzeros":  box1 = "Xzeros":  box2 = ""
        If Num > WordCount(Xzeros, last) Then
          Call mdlCommonFiles.checkArraySize2(code, Num, nbox, box1, box2)
          Xzeros = FixCount(Xzeros, last):   exitMe = 1
        End If
      ElseIf code = 3 Then
' nXzeros & Bounds
        Num = nXzeros:  nbox = "nXzeros":  box1 = "Bounds":  box2 = "Xzeros"
        If (Num > WordCount(Bounds, last)) And (mSolver <> 0) Then
          Call mdlCommonFiles.checkArraySize2(code, Num, nbox, box1, box2)
          Bounds = FixCount(Bounds, last):   exitMe = 1
        End If
      ElseIf code = 4 Then
' n Zreal
        Num = nZpairs + nZquads:  nbox = "'nZpairs'+'nZquads'":  box1 = "Zreal":  box2 = ""
        If Num > WordCount(Zreal, last) Then
          Call mdlCommonFiles.checkArraySize2(code, Num, nbox, box1, box2)
          Zreal = FixCount(Zreal, last):   exitMe = 1
       End If
      ElseIf code = 5 Then
' n Zimag
        Num = nZpairs + nZquads:  nbox = "'nZpairs'+'nZquads'":  box1 = "Zimag":  box2 = ""
        If Num > WordCount(Zimag, last) Then
          Call mdlCommonFiles.checkArraySize2(code, Num, nbox, box1, box2)
          Zimag = FixCount(Zimag, last):   exitMe = 1
        End If
      End If
 '   End With
End Sub
Private Function WordCount(str As String, last As Integer)
  Call SplitMe(str, words(), last)
  WordCount = last + 1
End Function
Private Sub SplitMe(strText As String, words() As String, last As Integer)
      Dim str As String
      str = Trim(strText)
      Do While Val(InStr(str, String(2, " "))) > 0
        str = Replace(str, String(2, " "), " ")
      Loop
      words() = Split(str):   last = UBound(words)
End Sub
Private Function FixCount(strText As String, last As Integer) As String
      tmp = ""
      Do While Num > last
        tmp = tmp & " 1":   last = last + 1
      Loop
      FixCount = Trim$(strText & " " & tmp)
End Function

Private Sub Exam_Click(Index As Integer)
      fileDemo = Exam(Index).Caption
End Sub
Private Sub varyPZ_Click()
      isDirty = True
      lblQuestion(2).ForeColor = vbInfoText
      If varyPZ.ListIndex >= 2 And varyPZ.ListIndex <= 4 Then 'By Index
        MsgBox ProgramName & " will use this Selected item in the future" & _
          " but not now; valid options are 0, 1, & 5.", vbInformation, "Limited Options"
'        varyPZ.sleep (1000) ' Change Delay as you see fit
        varyPZ.ListIndex = 5 'Make it go away
      End If
End Sub
Private Sub varyPZ_GotFocus()
    ' highlight contents on entry
      varyPZ.SelStart = 0:      varyPZ.SelLength = 9999
End Sub
Private Sub Tmin_Change()
        isDirty = True
End Sub
Private Sub Tmin_GotFocus()
    ' highlight contents on entry
      Tmin.SelStart = 0:      Tmin.SelLength = 9999
End Sub
Private Sub GDunitFactor_Change()
        isDirty = True
        lblQuestion(4).ForeColor = vbInfoText
End Sub
Private Sub holdZerosAbove_Change()
        isDirty = True
        lblQuestion(5).ForeColor = vbInfoText
End Sub
Private Sub holdZerosAbove_GotFocus()
    ' highlight contents on entry
      holdZerosAbove.SelStart = 0:      holdZerosAbove.SelLength = 9999
End Sub
Private Sub GDunitFactor_GotFocus()
    ' highlight contents on entry
      GDunitFactor.SelStart = 0:      GDunitFactor.SelLength = 9999
End Sub
Private Sub Radius_Change()
        isDirty = True
        lblQuestion(6).ForeColor = vbInfoText
End Sub
Private Sub Radius_GotFocus()
    ' highlight contents on entry
      Radius.SelStart = 0:      Radius.SelLength = 9999
End Sub
Private Sub freqNorm_Change()
        isDirty = True
End Sub
Private Sub freqNorm_GotFocus()
    ' highlight contents on entry
      freqNorm.SelStart = 0:      freqNorm.SelLength = 9999
End Sub

Private Sub nAllPoles_Change()
        isDirty = True
End Sub
Private Sub nAllPoles_GotFocus()
    ' highlight contents on entry
      nAllPoles.SelStart = 0:      nAllPoles.SelLength = 9999
End Sub
Private Sub nAllPoles_LostFocus()
      Dim last As Integer, nYpole As Integer
      If Trim(nAllPoles) = "" Then
        sigmaPoles.Enabled = False:  poleReal.Enabled = False
        poleImag.Enabled = False:  Exit Sub
      End If
      Call SplitMe(nAllPoles, words(), last)
      nYpole = words(0):      nPoles = words(1)
      If last < 1 Then Exit Sub
      If Val(nYpole) = 0 Then
         sigmaPoles.Enabled = False
      Else
         sigmaPoles.Enabled = True
         If frmMain.Visible Then sigmaPoles.ZOrder
         sigmaPoles = ".3"
      End If
          If Len(Trim(poleReal)) > 0 Then Exit Sub
      Num = Val(nPoles):  Call CreateData(poleReal, 1, 0)
      Call CreateData(poleImag, 0, -99)
      If sigmaPoles.Enabled = False Then poleReal.ZOrder
End Sub
Private Sub CreateData(aTextBox As TextBox, start As Long, step As Double)
      If Num = 0 Then
         aTextBox.Enabled = False:  Exit Sub
      Else
         aTextBox.Enabled = True
         aTextBox = Trim(aTextBox) & " " & CreateWord(start, step)
      End If
End Sub
Private Function CreateWord(start As Long, step As Double) As String
      Dim str As String, stp As Double, last As Integer
      If Num = 0 Then Exit Function
      If step = -99 Then
        stp = 1 / CDbl(Num): step = 0.1
        If stp < 0.01 Then step = 0.01
        If stp > 0.01 And stp < 0.02 Then step = 0.01
        If stp > 0.02 And stp < 0.05 Then step = 0.02
        If stp > 0.05 And stp < 0.1 Then step = 0.05
      End If
      str = " ":    last = 0
      Do While Num > last
        str = str & " " & CStr(start + last * step):    last = last + 1
      Loop
      CreateWord = Trim$(str)
End Function
Private Sub sigmaPoles_Change()
        isDirty = True
End Sub
Private Sub sigmaPoles_GotFocus()
    ' highlight contents on entry
      sigmaPoles.SelStart = 0:      sigmaPoles.SelLength = 9999
End Sub
Private Sub poleReal_Change()
        isDirty = True
End Sub
Private Sub poleReal_GotFocus()
    ' highlight contents on entry
      poleReal.SelStart = 0:      poleReal.SelLength = 9999
End Sub
Private Sub poleImag_Change()
        isDirty = True
End Sub
Private Sub poleImag_GotFocus()
    ' highlight contents on entry
      poleImag.SelStart = 0:      poleImag.SelLength = 9999
End Sub
Private Sub chkSigmaZero_Click()
        isDirty = True
End Sub
Private Sub chkSigmaZero_LostFocus()
      If chkSigmaZero.value = vbChecked Then
         chkDoublet.Enabled = True:          chkLossless.Enabled = True
         sigmaZero.Enabled = True:     If frmMain.Visible Then sigmaZero.ZOrder
         sigmaZero.SetFocus
      Else
         chkDoublet.Enabled = False:         chkLossless.Enabled = False
         sigmaZero.Enabled = False:     '    nXzeros.SetFocus
      End If
End Sub
Private Sub sigmaZero_Change()
        isDirty = True
End Sub
Private Sub sigmaZero_GotFocus()
    ' highlight contents on entry
      sigmaZero.SelStart = 0:      sigmaZero.SelLength = 9999
End Sub
Private Sub chkDoublet_Click()
        isDirty = True
End Sub
Private Sub chkLossless_Click()
        isDirty = True
End Sub
Private Sub nXzeros_Change()
        isDirty = True
End Sub
Private Sub nXzeros_LostFocus()
      If Trim(nXzeros) = "" Then Exit Sub
      If Val(nXzeros) = 0 Then
         Xzeros.Enabled = False
      Else
         Xzeros.Enabled = True
         If frmMain.Visible Then Xzeros.ZOrder
             If Len(Trim(Xzeros)) > 0 Then Exit Sub
         Num = Val(nXzeros):  Call CreateData(Xzeros, 1, -99)
      End If
End Sub
Private Sub nZpairs_Change()
        isDirty = True
End Sub
Private Sub nZpairs_LostFocus()
      If Trim(nZpairs) = "" Then Exit Sub
      If Val(nZpairs) + Val(nZquads) = 0 Then
         Zreal.Enabled = False:  Zimag.Enabled = False:  Exit Sub
      Else
         Zreal.Enabled = True:          Zimag.Enabled = True
 '        If frmMain.Visible And Not Zimag.Enabled Then Zimag.ZOrder
             If Len(Trim(Zreal)) > 0 Then Exit Sub
         Num = Val(nZpairs):  Call CreateData(Zreal, 1, 0)
         Call CreateData(Zimag, 0, -99)
      End If
End Sub
Private Sub nZquads_Change()
        isDirty = True
End Sub
Private Sub nZquads_LostFocus()
      If Trim(nZquads) = "" Then Exit Sub
      If Val(nZpairs) + Val(nZquads) = 0 Then
         Zreal.Enabled = False:  Zimag.Enabled = False:  Exit Sub
      Else
         Zreal.Enabled = True:          Zimag.Enabled = True
  '       If frmMain.Visible And Not Zimag.Enabled Then Zimag.ZOrder
' nZpairs + nZquads
             If Len(Trim(Zreal)) > 0 Then Exit Sub
         Num = Val(nZquads):  Call CreateData(Zreal, 1, 0):  Zreal = Trim(Zreal)
         Call CreateData(Zimag, 1, 0.05):  Zimag = Trim(Zimag)
      End If
End Sub
Private Sub Xzeros_Change()
        isDirty = True
End Sub
Private Sub Xzeros_GotFocus()
      Xzeros.SelStart = 0:      Xzeros.SelLength = 9999
End Sub
Private Sub Zreal_Change()
        isDirty = True
End Sub
Private Sub Zreal_GotFocus()
    ' highlight contents on entry
      Zreal.SelStart = 0:      Zreal.SelLength = 9999
End Sub
Private Sub Zimag_Change()
        isDirty = True
End Sub
Private Sub Zimag_GotFocus()
    ' highlight contents on entry
      Zimag.SelStart = 0:      Zimag.SelLength = 9999
End Sub

Private Sub Gain_Change()
        isDirty = True
End Sub
Private Sub LowestX_Y_Change()
        isDirty = True
End Sub
Private Sub maxX_Y_Change()
        isDirty = True
End Sub
Private Sub Note1_Change()
        isDirty = True
End Sub
Private Sub Note1_GotFocus()
    ' highlight contents on entry
      Note1.SelStart = 0:      Note1.SelLength = 9999
End Sub
Private Sub Note2_Change()
        isDirty = True
End Sub
Private Sub Note2_GotFocus()
    ' highlight contents on entry
      Note2.SelStart = 0:      Note2.SelLength = 9999
End Sub
Private Sub Remax_Change()
        isDirty = True
End Sub
Private Sub Summary_Change()
        isDirty = True
End Sub
Private Sub Zero_Change()
        isDirty = True
End Sub
Private Sub StepsLim_Change()
        isDirty = True
End Sub
Private Sub StepOut_Change()
        isDirty = True
End Sub
Private Sub EvalMax_Change()
        isDirty = True
End Sub
Private Sub Bounds_Change()
        isDirty = True
End Sub
Private Sub ChangeTab(SSTab As SSTab)
      Dim ctrl As Control, TabIndex As Long
    
      TabIndex = 99999          ' A very high value.
      On Error Resume Next
        
      For Each ctrl In SSTab.Parent.Controls
        If ctrl.Container Is SSTab Then
          If Left$(ctrl.Name, 3) <> "mnu" And Left$(ctrl.Name, 3) <> "lbl" Then
            If ctrl.Left < -10000 Then
              ctrl.Enabled = False
            Else
              ctrl.Enabled = True
              If ctrl.TabIndex >= TabIndex Then
                ' this control comes after our best candidate or
                ' ctrl doesn't support the TabIndex property.
              Else
                ' This is the best candidate to get the focus (so far).
                TabIndex = ctrl.TabIndex
                ' (Next statement may fail with a few controls (e.g. Labels)
               ctrl.SetFocus
              End If
            End If
          End If
        End If
      Next
      If restore Then restoreTabStops
      With PassData.Parent
            .Controls("varyPZ").TabStop = True
            .Controls("Tmin").TabStop = True
            .Controls("GDunitFactor").TabStop = True
            .Controls("holdZerosAbove").TabStop = True
            .Controls("Radius").TabStop = True
            .Controls("freqNorm").TabStop = True
            .Controls("Gain").TabStop = True
            .Controls("LowestX_Y").TabStop = True
            .Controls("maxX_Y").TabStop = True
            .Controls("Note1").TabStop = True
            .Controls("Note2").TabStop = True
            .Controls("ODE_Tabs").TabStop = True
    '  .Controls("PassData").TabStop = True
     ' .Controls("txtpassCellEditor").TabStop = True
      '.Controls("cmdClearPassData").TabStop = True
'      .Controls("DelayData").TabStop = True
 '     .Controls("cmdClearDelayData").TabStop = True
     ' .Controls("txtDelayCellEditor").TabStop = True
            .Controls("Remax").TabStop = True
            .Controls("Summary").TabStop = True
            .Controls("Zero").TabStop = True
            .Controls("StepsLim").TabStop = True
            .Controls("StepOut").TabStop = True
            .Controls("EvalMax").TabStop = True
            .Controls("Bounds").TabStop = True
           '.Controls("cmdCancelDemo").TabStop = True
            .Controls("cmdDefaultSolverData").TabStop = True
            .Controls("cmdEditSolverData").TabStop = True
  '         .Controls("cmdPlots").TabStop = True
   '        .Controls("cmdRunDemo").TabStop = True
    '       .Controls("cmdSubmit").TabStop = True
      End With
End Sub
Public Sub ClearBoth()
        Set grid = PassData:     ClearGrid
        Set grid = DelayData:    ClearGrid
End Sub
Public Sub ClearGrid()
        Dim wCol(3) As Long, ncols As Integer
        If grid Is PassData Then
          ncols = 2:    nFreqPoints = 0
          Call HideCellEditor(txtPassCellEditor, True)
          Call ShowCellEditor(txtPassCellEditor)
        Else
          ncols = 1:    nDelayPts = 0
          Call HideCellEditor(txtDelayCellEditor, True)
          Call ShowCellEditor(txtDelayCellEditor)
        End If
        With grid
          For i = 0 To ncols
            wCol(i) = .ColWidth(i + 1)
          Next
          .Clear:       .Rows = 3:      Call FormatGrid:  .Row = 1: .Col = 1
          For i = 0 To ncols
            .ColWidth(i + 1) = wCol(i)
          Next
        End With
'        HideCellEditor True:     ShowCellEditor (txtDelayCellEditor)
End Sub
Public Sub clearSolvdata()
      Remax = "":      Summary = "":      Zero = "":      StepsLim = ""
      StepOut = "":    EvalMax = "":     Bounds = ""
End Sub
Private Sub visibleTabs(allTrue As Boolean)
      For i = 0 To ODE_Tabs.Tabs - 1
         ODE_Tabs.TabVisible(i) = allTrue
      Next
End Sub
Public Sub FormatGrid()
        Dim i As Integer
        If grid Is PassData Then
          PassData.FormatString = "#|^      Frequency|^                        Yin|^                     Yout;#"
        Else
          DelayData.FormatString = "#|^      Frequency|^                   Delay (tx);#"
        End If
        With grid
          For i = 1 To .Rows
             .FormatString = .FormatString & "|" & CStr(i)
          Next i
          .Rows = .Rows - 1       ' must do due to a bug in above loop!!!
        End With
End Sub
Private Sub Form_Load()
      On Error GoTo errhandler

    For i = 1 To 4
        mnuRegFile(i).Caption = GetSetting("MyProg", "filemenu", i, "")
        If mnuRegFile(i).Caption <> "" Then mnuRegFile(i).Visible = True
    Next
 
    If mnuRegFile(1).Visible = True Then mnuSep.Visible = True


      Note1.Width = Width - 333:     Note2.Width = Note1.Width
      ODE_Tabs.Tab = 0:        fileDemo = Exam(1).Caption
    With varyPZ
      .AddItem "0->No tweaking just calculations"
      .AddItem "1->Sidelobe Equalize Ripple"
      .AddItem "2->??? not-in-use"
      .AddItem "3->Zeros Only"
      .AddItem "4->Poles Only"
      .AddItem "5->Both Poles & Zeros"
          .ListIndex = 5                ' default Item set
'      varyPZ = .ListIndex
'      ???.Items(3).Enabled = False
    End With
    lblQuestion(1) = "1. » used to state version of app. "
    lblQuestion(2) = "2. » 0->No tweaking, 1->Sidelobe Equalize Ripple, 3->Zeros Only, 4->Poles Only, and 5->Both Poles && Zero?"
    lblQuestion(3) = "3. » Desire a specific group delay value Desired?  If not, enter a '0' for Desired value."
    lblQuestion(4) = "4. » Constant to balance, group delay, Tmin && Tx (see 'Delay Data' Tab) values; default = 1e3?"
    lblQuestion(5) = "5. » Lower Bound for |zero| sigma values; default = 20+% of Freq Norm (below)?"
    lblQuestion(6) = "6. » 'Radius' value: radius from origin to contain All your Poles; default = 50+% of 'Freq Norm'?"
    lblQuestion(7) = "7. » Freq Norm ... upper passband Frequency limit & 1st sidelobe zero" _
                & " on omega-axis if one exists.  Units are assumed to be mega-hertz."
' Tab0questions = 7
    lblQuestion(8) = "8. » No. of Poles on Sigma axis and pairs; e.g. 0 4 => 0 Sigma + 4 pairs?"
    lblQuestion(9) = "8a. » Sigma-axis Pole ... REAL value?"
    lblQuestion(10) = "8b. » Pole pairs ... REAL values?"
    lblQuestion(11) = "8c. »            ... IMAGINARY values?"
    lblQuestion(12) = "9. » Want a -Zero- on the Sigma-axis?"
    lblQuestion(13) = "9a. » Sigma Zero -initial- value?"
    lblQuestion(14) = "9b. » Is Sigma Zero a 'Doublet'?"
    lblQuestion(15) = "9c. » Is Sigma Zero 'Lossless'?"
    lblQuestion(16) = "10. »  No. of Zero types; ie. S. omega axis, P. pairs && Q. quads?"
    lblQuestion(17) = "10a »  Omega-axis Zero ... IMAGINARY values (>= 1.0)?"
    lblQuestion(18) = "10b »  Zero pairs then quads ... REAL values?"
    lblQuestion(19) = "10c »                        ... IMAGINARY values?"
' Tab2questions = 19
    lblQuestion(20) = "11. »  Initial GAIN value for H(s)?"
    lblQuestion(21) = "12. »  Smallest |Sigma-axis value| for Poles and  Zeros?"
    lblQuestion(22) = "13. »  Max. |Sigma-axis| parameter values for Poles?"
' Tab3questions = 14
    Quest(mQuestions + 1) = "23. »  # of Freq. points, nFreqPoints, not a user prompt; i.e. a calculated value."
'       Answer = {"4", "76.7", "-2", "-9", "6", \\
 '                "1 4", ".02", ".1 .1 .1 .1", ".2 .3 .4 .5", \\
  '               "N", ".05", "N", "Y", "1 0 0", "2.5", "1", ".6", "1.23", ".018", "20"}          ' total = 13+5
   '    Freq = { "0",  ".98",  "1.96",  "2.94",  "3.92",  "4.90",  "5.88",  "6.86",  "7.84",  "8.82",  "9.80",  "10.78",  "11.76",  "12.74",  \\
    '             "13.72",  "14.70",  "15.68",  "16.66",  "17.64",  "18.62",  "19.60",  "20.58",  "21.56",  "22.54",  "23.52"}
     '  Yin = {"51.31",  "37.79",  "28.26",  "21.1",  "15.37",  "11.32",  "8.06",  "5.83",  "3.91",  "2.69",  "1.78",  ".96",  ".52",  ".31",  \\
      '           ".25",  ".21",  ".18",  ".15",  ".12",  ".10",  ".08",  ".07",  ".06",  ".06",  ".05"}
'       Yout = {"1", ".981", ".926",  ".836",  ".73",  ".609",  ".484",  ".365",  ".26",  ".173",  ".105",  ".058",  ".027",  ".012",  \\
 '                "7.2E-3",  "4.4E-3",  "2.7E-3",  "1.7E-3",  "1E-3",  "6.2E-4",  "3.8E-4",  "2.3E-4",  "1.4E-4",  "8.8E-5",  "5.4E-5"}
      ODE_Tabs.Tab = 0:        fileDemo = Exam(1).Caption
      Set grid = PassData:    restore = False
      ODE_Tabs.TabVisible(0) = True:       ODE_Tabs.TabVisible(1) = False
      With PassData
        .Enabled = False:      .Cols = 4:      .Rows = 3
        txtPassCellEditor.Visible = False
        Set txtPassCellEditor.Font = .Font
      End With
      With DelayData
        .Enabled = False:      .Cols = 3:      .Rows = 3
        txtDelayCellEditor.Visible = False
        Set txtDelayCellEditor.Font = .Font
      End With
      Call SetColWidth

        CMDialog1.FilterIndex = 2
        fileIn = GetFileInRegistry()    ' + gets userPath
        fileInPath = App.path & "\" & userPath
        If userPath = "" Then fileInPath = App.path
        fileTempPath = fileInPath   ' for starting
        tmp = fileInPath
        ChDir tmp
        tmp = tmp & "\" & fileIn
      If FileExists(tmp) And LCase$(Left$(fileIn, 2)) <> "ex" And fileIn <> "" Then
        fileTemp = fileIn:  fileIO = FreeFile()
        Open tmp For Input As #fileIO
        Call FileReadMe(fileTemp, fileTempPath):       Close #fileIO
        Call GetAnswers
      Else
        If LCase$(Left$(fileIn, 2)) = "ex" Then fileIn = ""
        Call PutAnswers
      End If
      Call Start_INI    ' ... put into frmIntro. 8/29/02 ... back here 1/2/03
      Call FileNamesAndPaths(fileIn)
      isDirty = False

      If RunCount < 1 Then
        MsgBox ProgramName & " program determines the best parameter values for " & _
          "Pole/Zero locations in order to Match transfer function, H(s).  This type " & _
          "of problem may be called an Inverse Problem (IP); i.e. you know what you " & _
          "want to do, but not sure how to get there. This algebraic problem states " & _
          "a math model with some unknowns to be found. " & vbCrLf & vbCrLf & _
          "In Calculus level programming the user/programmer states their equations " & _
          "and a objective function and leaves the numerical work to the compiler. " & _
          "This is accomplished thru Automatic Differentiation (AD) and Operator  " & _
          "Overload techniques.", vbOKOnly, "Intro to " & ProgramName & ""

' MakeFileAssociation(Extension, PathToApplication, ApplicationName, Description, Optional FullIconPath)
          installPath = App.path & "\.."
          Call MakeFileAssociation("Out", installPath, "MyEditor.bat", "FC Output")
          installPath = App.path & "\.."
          Call MakeFileAssociation("plt", installPath, "ODE-XYplots", "XYplot file")
          If FileExists(installPath & "\f32main.exe") Then
            Call MakeFileAssociation("prz", installPath, "f32main.exe", "FC Presentation")
          End If
       End If

        Call thisFormLoad(frmMain)
        Call ReSize_RTB
        Me.Show:       Exit Sub

errhandler:
   If Err.Number = ErrDeviceUnavailable Then
      MsgBox "This drive or path does not exist: " & App.path, _
          vbExclamation, "In 'Form_Load' routine ...": Resume
   ElseIf Err.Number = ErrDialogCancel Then Exit Sub
   ElseIf Err.Number <> 0 Then
      MsgBox "Unexpected error #" & str(Err.Number) & " occured: " & _
            Err.Description & " ... fileTemp = " & fileTemp & vbCrLf & " ... fileTempPath = " _
            & fileTempPath & vbCrLf _
            & "appPath = " & App.path & vbCrLf, vbCritical, "In 'form_load' routine ..."
      Call exitProgram
      Unload frmMain
   End If
End Sub
Private Sub Form_Resize()
        If (ScaleWidth < 1000 Or ScaleHeight < 1000) Then Exit Sub
        Call thisFormResize(frmMain)
        Call ReSize_RTB
End Sub
Private Sub form_unload(cancel As Integer)
      Call exitProgram
End Sub
Public Sub GetAnswers()         'getting Answers from a file
      On Error GoTo errhandler

      Dim isTmp As Boolean:  isTmp = isDirty
      
      If Answer(1) = "Y" Or Answer(1) = "y" Then
        varyPZ.ListIndex = 5:  Tmin = Answer(2)
        GDunitFactor = "":  holdZerosAbove = "":   Radius = ""
        lblQuestion(2).ForeColor = vbRed:  lblQuestion(4).ForeColor = vbRed
        lblQuestion(5).ForeColor = vbRed:  lblQuestion(6).ForeColor = vbRed
      Else
        varyPZ.ListIndex = Val(Answer(2)):  Tmin = Answer(3):  GDunitFactor = Answer(4)
        holdZerosAbove = Answer(5):  Radius = Answer(6)
      End If
      freqNorm = Answer(7)

' Tab0questions = 7
      nAllPoles = Answer(8)
      sigmaPoles = Answer(9):      poleReal = Answer(10):   poleImag = Answer(11)
      If Answer(12) = "Y" Or Answer(12) = "y" Then
         chkSigmaZero = 1
      Else
         chkSigmaZero = 0
      End If
      sigmaZero = Answer(13)
      If Answer(14) = "Y" Or Answer(14) = "y" Then
         chkDoublet = 1
      Else
         chkDoublet = 0
      End If
      If Answer(15) = "Y" Or Answer(15) = "y" Then
         chkLossless = 1
      Else
         chkLossless = 0
      End If
      If Answer(16) <> "" Then
        Dim last As Integer
        Call SplitMe(Answer(16), words(), last)
        nXzeros = words(0):      nZpairs = words(1):        nZquads = words(2)
      Else
        nXzeros = "0":      nZpairs = "0":        nZquads = "0"
      End If
      Xzeros = Answer(17):      Zreal = Answer(18):        Zimag = Answer(19)
' Tab2questions = 19
      Gain = Answer(20):       LowestX_Y = Answer(21):    maxX_Y = Answer(22)
      Set grid = PassData:      ClearGrid
      nFreqPoints = Val(Answer(mQuestions + 1))
      Set grid = DelayData:      ClearGrid
      nDelayPts = Val(Answer(mQuestions + 2))
      Note1 = AnsNote1:         Note2 = AnsNote2

      Set grid = PassData
      With PassData
        If nFreqPoints > 0 Then        'a Passband!
           For i = 1 To nFreqPoints
              xyGridAddRow
              .TextMatrix(i, 1) = Freq(i):    .TextMatrix(i, 2) = Yin(i)
              .TextMatrix(i, 3) = Yout(i)
           Next i
           xyGridAddRow True
           txtPassCellEditor.Text = Freq(1)
        Else
           txtPassCellEditor.Text = ""
        End If
        cellRowPass = 1: cellColPass = 1
      End With

      Set grid = DelayData
      With DelayData
        If nDelayPts > 0 Then
           For i = 1 To nDelayPts
              xyGridAddRow
              .TextMatrix(i, 1) = DelFreq(i):    .TextMatrix(i, 2) = tx(i)
           Next i
           xyGridAddRow True
           txtDelayCellEditor.Text = DelFreq(1)
        Else
           txtDelayCellEditor.Text = ""
        End If
        cellRowDelay = 1: cellColDelay = 1
      End With
      Call GetSolvAnswers:    Call SetCols4PassData:   Call setEnabled: isDirty = isTmp
      Exit Sub

errhandler:
       ' The user clicked the Cancel button.
      If Err.Number = ErrDialogCancel Then Exit Sub
      MsgBox "Unexpected error #" & str(Err.Number) & " occured: " & _
            Err.Description, vbCritical, "In 'GetAnswers' routine ..."
End Sub
Public Sub GetSolvAnswers()
      Remax = SolvAnswer(1):     Summary = SolvAnswer(2):    Zero = SolvAnswer(3)
      StepsLim = SolvAnswer(4):  StepOut = SolvAnswer(5):   EvalMax = SolvAnswer(6)
      Bounds = SolvAnswer(7)
      If Remax + Summary = "" Then
        Call SolvEnabled(False)
      Else
        Call SolvEnabled(True)
      End If
End Sub
Sub HideCellEditor(tb As TextBox, Optional cancel As Boolean)
      ' Hide the textbox if necessary.
      If tb.Visible Then
          ' If the operation hasn't been canceled, transfer the contents
          ' of the textbox into the original active cell.
          If Not cancel Then
             If grid.Cols - 1 < cellCol Then cellCol = cellCol - 1
             grid.TextMatrix(cellRow, cellCol) = tb.Text
          End If
          tb.Visible = False
      End If
      If restore Then restoreTabStops
End Sub
Private Function isComplete() As Boolean         'test Answers from screen
      Dim i As Integer
'      On Error GoTo Error_Handler

      isComplete = True:   Call PutAnswers
      For i = 1 To mQuestions
        lblQuestion(i).ForeColor = vbInfoText
      Next i
      For i = 1 To 8
        If Answer(i) = "" Or Answer(i) = "-Select-" Then
          lblQuestion(i).ForeColor = vbRed:     isComplete = False
        End If
      Next i
      For i = 10 To 11
        If Answer(i) = "" Or Answer(i) = "-Select-" Then
          lblQuestion(i).ForeColor = vbRed:     isComplete = False
        End If
      Next i
      If Answer(16) = "" Then
        lblQuestion(16).ForeColor = vbRed:     isComplete = False
      End If
      For i = 20 To 22
        If Answer(i) = "" Or Answer(i) = "-Select-" Then
          lblQuestion(i).ForeColor = vbRed:     isComplete = False
        End If
      Next i
End Function
Public Function isCompleteTest() As Boolean
      isCompleteTest = True
      If Not isComplete Then
         MsgBox "Some fields are Blank, please fill them and submit again", vbExclamation + vbOKOnly, _
         "Missing some data fields"
         isCompleteTest = False
      End If
End Function
Public Function mailto(Msg As String) As Integer
   #If Win16 Then
        Dim retval As Integer
   #Else
        Dim retval As Long
   #End If
        Msg = Replace(Msg, " ", "%20")
       'Sending eMail
        retval = ShellExecute(Me.hwnd, "open", Msg, vbNullString, vbNullString, vbNormalFocus)  ' or SW_SHOWNORMAL)
        mailto = retval
        If retval > 32 Then Exit Function

'        retval = ShellExecute(Me.hwnd, "open", "c:\program files\outlook express\msimn.exe", "/mailurl:" _
 '           & Replace(Msg, "two%20lines", "three%20lines"), vbNullString, vbNormalFocus)
  '      mailto = retval
End Function
Private Sub mnuDemosRun_Click()
      If fileModified(isDirty) Then Exit Sub
      tmp = fileIn:     tmp2 = fileInPath:
      Call setTabs(False):      ODE_Tabs.TabVisible(1) = True:      ODE_Tabs.Tab = 1
End Sub
Private Sub mnuFileNew_Click()
        For i = 1 To mQuestions
          lblQuestion(i).ForeColor = vbInfoText
        Next i
        Call FileNew
End Sub
Private Sub mnuFileOpen_Click()
        For i = 1 To mQuestions
          lblQuestion(i).ForeColor = vbInfoText
        Next i
        Call FileOld:      exitSub = 0
        fileIn = fileIn & "." & FCshort
        fileIn = Replace(fileIn, FCshort & "." & FCshort, FCshort, , , vbTextCompare)  'removing filetype from file name
End Sub
Private Sub mnuFileSave_Click()
        Call FileSave:     exitSub = 0
End Sub
Private Sub mnuFileSaveAs_Click()
        Call FileSaveAs:      exitSub = 0
End Sub
Private Sub mnuFileDelete_Click()
        Call FileDel
End Sub
Private Sub mnuFileSubmit_Click()
      Call cmdSubmit_Click
End Sub
Private Sub mnuFileExit_Click()
        Unload Me
End Sub
Private Sub mnuViewDemos_Click()
      Call ViewDemos
End Sub


 
Private Sub mnuOpen_Click()
    Err.Clear
    On Error GoTo ErrHandle
    With CDlog
        .Filename = ""
        .Flags = cdlOFNFileMustExist + cdlOFNHideReadOnly
        .ShowOpen
    End With
    Open CDlog.Filename For Input As #1
    temp = Input(LOF(1), 1)
    Close #1
    txtTest.Text = temp
    
    AddRegList
 
    Exit Sub
 
ErrHandle:
    Close #1
    MsgBox Err.Description, vbCritical, "Open Error"
 
End Sub
 
Private Sub AddRegList()
    For i = 1 To 4
        mnuRegFile(i).Caption = GetSetting("MyProg", "filemenu", i, "")
    Next
    
    blnOnList = False                           'check if its already
    For i = 1 To 4
        If CDlog.Filename = mnuRegFile(i).Caption Then
            blnOnList = True
            Exit For
        End If
    Next                                        'on the list
    
    If blnOnList = True And i < 4 Then
        Select Case i
            Case 2
                mnuRegFile(2).Caption = mnuRegFile(1).Caption
                mnuRegFile(1).Caption = CDlog.Filename
            Case 3
                mnuRegFile(3).Caption = mnuRegFile(2).Caption
                mnuRegFile(2).Caption = mnuRegFile(1).Caption
                mnuRegFile(1).Caption = CDlog.Filename
        End Select
    Else
        mnuRegFile(4).Caption = mnuRegFile(3).Caption
        mnuRegFile(3).Caption = mnuRegFile(2).Caption
        mnuRegFile(2).Caption = mnuRegFile(1).Caption
        mnuRegFile(1).Caption = CDlog.Filename
    End If
    
    mnuRegFile(1).Visible = True
    mnuSep.Visible = True
    For i = 2 To 4
        If mnuRegFile(i).Caption <> "" Then mnuRegFile(i).Visible = True
    Next i
    
    For i = 1 To 4
        SaveSetting "MyProg", "filemenu", i, mnuRegFile(i).Caption
    Next i
End Sub
 
Private Sub mnuRegFile_Click(Index As Integer)
    Err.Clear
    On Error GoTo ErrHandle
    CDlog.Filename = GetSetting("MyProg", "filemenu", Index, "")
    Open CDlog.Filename For Input As #1
    temp = Input(LOF(1), 1)
    Close #1
    txtTest.Text = temp
    
    AddRegList
    
    Exit Sub
    
ErrHandle:
    Close #1
    MsgBox Err.Description, vbCritical, "Error"
End Sub

Private Sub mnuViewFeatures_Click()
        ShellExecute Me.hwnd, "Open", App.path + "\..\install-stuff\FortranCalculus-flyer.doc", "", "", vbNormalFocus
End Sub
Private Sub mnuViewOutput_Click()
      Call ViewOutput("~mFilter7.out")
End Sub
Private Sub mnuViewPlots_Click()
      Call viewPlots
End Sub
Private Sub mnuWebPres_Click()
'     Manufacturing-Presentation.
       ShellExecute Me.hwnd, "Open", "https://www.researchgate.net/publication/331634333_Improve_Math_Models_while_Increasing_Productivity?showFulltext=1", "", "", vbNormalFocus
End Sub
Private Sub mnuWebVideo_Click()
'     "Match Filter.mp4" video
       ShellExecute Me.hwnd, "Open", "https://www.slideshare.net/PhilBrubaker1/matched-filter-class", "", "", vbNormalFocus
End Sub
Private Sub mnuWebLink_Click()
        ShellExecute Me.hwnd, "Open", "https://goal-driven.net/example/mag-recording.html", "", "", vbNormalFocus
End Sub
Private Sub mnuWebLink2_Click()
        ShellExecute Me.hwnd, "Open", "https://goal-driven.net/example/filter-designing.html", "", "", vbNormalFocus
End Sub
Private Sub mnuWebLink3_Click()
        ShellExecute Me.hwnd, "Open", "https://goal-driven.net/example/pulse-slimming.html", "", "", vbNormalFocus
End Sub
Private Sub mnuWebLink4_Click()
        ShellExecute Me.hwnd, "Open", "https://goal-driven.net/textbooks/index.html", "", "", vbNormalFocus
End Sub
Private Sub mnuWebLinkEd_Click()
        ShellExecute Me.hwnd, "Open", "http://notepad-plus-plus.org/", "", "", vbNormalFocus
End Sub
Private Sub mnuWebLinkComp_Click()
        ShellExecute Me.hwnd, "Open", "https://goal-driven.net/apps/fc-compiler.html", "", "", vbNormalFocus
End Sub
Private Sub mnuWebLinkC_Click()
        ShellExecute Me.hwnd, "Open", "https://goal-driven.net/apps/curvfit.html", "", "", vbNormalFocus
End Sub
Private Sub mnuWebLinkR_Click()
        ShellExecute Me.hwnd, "Open", "https://goal-driven.net/apps/robot4.html", "", "", vbNormalFocus
End Sub
Private Sub mnuWebLinkS_Click()
        ShellExecute Me.hwnd, "Open", "https://goal-driven.net/apps/spectrumsolvers.html", "", "", vbNormalFocus
End Sub
Private Sub mnuHelpPrayer_Click()
        ShellExecute Me.hwnd, "Open", "https://goal-driven.net/misc/prayertree.html", "", "", vbNormalFocus
End Sub
Private Sub mnuHelpDonate_Click()
        ShellExecute Me.hwnd, "Open", App.path + "\..\donate.html", "", "", vbNormalFocus
End Sub
Private Sub mnuHelpAbout_Click()
      frmAbout.Show 1
End Sub
Private Sub mnuHelpEmail_Click()
      frmEmail.Show 1
End Sub
Private Sub mnuHelpClass_Click()
'     Manufacturing-class.
       ShellExecute Me.hwnd, "Open", "https://www.researchgate.net/publication/331634333_Improve_Math_Models_while_Increasing_Productivity?showFulltext=1", "", "", vbNormalFocus
End Sub
Private Sub mnuHelpVideos_Click()
        ShellExecute Me.hwnd, "Open", "https://goal-driven.net/videos/", "", "", vbNormalFocus
End Sub
Private Sub mnuHelpForum_Click()
        ShellExecute Me.hwnd, "Open", "https://www.researchgate.net/profile/Phil_Brubaker", "", "", vbNormalFocus
 '       ShellExecute Me.hwnd, "Open", "https://www.quora.com/profile/Phil-Brubaker-3", "", "", vbNormalFocus
End Sub
'Private Sub mnuHelpClasses_Click()
 '       ShellExecute Me.hwnd, "Open", "https://goal-driven.net/misc/zoom-math-classes.html", "", "", vbNormalFocus
'End Sub
Private Sub mnuHelpManual_Click()
        ShellExecute Me.hwnd, "Open", App.path + "\manual.rtf", "", "", vbNormalFocus
End Sub
' Validate the tab that is being abandoned.
Private Sub ODE_Tabs_click(PreviousTab As Integer)
        Static cancel As Boolean
        ' Avoid recursive calls
        If cancel Then Exit Sub

        ' Input focus management
        ChangeTab ODE_Tabs
        Call ReSize_RTB
End Sub
Private Sub ODE_Tabs_GotFocus()
        If ODE_Tabs.Tab = 4 Then
           Set grid = PassData
           cellRow = cellRowPass:    cellCol = cellColPass
           Call ShowCellEditor(txtPassCellEditor)
        ElseIf ODE_Tabs.Tab = 5 Then
           Set grid = DelayData
           cellRow = cellRowDelay:    cellCol = cellColDelay
           Call ShowCellEditor(txtDelayCellEditor)
        End If
End Sub
Private Sub ODE_Tabs_LostFocus()
        If ODE_Tabs.Tab = 4 Then
           cellRowPass = cellRow:  cellColPass = cellCol
        ElseIf ODE_Tabs.Tab = 5 Then
           cellRowDelay = cellRow:  cellColDelay = cellCol
        End If
End Sub
Public Sub PutAnswers()         'get Answers from screen
      Dim Count As Integer
      If demo <> "Demo" Then
         savedAs = fileIn
      End If
      Answer(1) = Version + "    version # ... input file"
      Answer(2) = varyPZ.ListIndex:  Answer(3) = Tmin:   Answer(4) = GDunitFactor
      Answer(5) = holdZerosAbove:    Answer(6) = Radius:    Answer(7) = freqNorm
      Answer(8) = nAllPoles
      Answer(9) = sigmaPoles:      Answer(10) = poleReal:    Answer(11) = poleImag
      If chkSigmaZero = vbChecked Then
         Answer(12) = "Y"
      Else
         Answer(12) = "N"
      End If
      Answer(13) = sigmaZero
      If chkDoublet = vbChecked Then
         Answer(14) = "Y"
      Else
         Answer(14) = "N"
      End If
      If chkLossless = vbChecked Then
         Answer(15) = "Y"
      Else
         Answer(15) = "N"
      End If

      Dim words(2) As String
      words(0) = nXzeros:      words(1) = nZpairs:         words(2) = nZquads
      Answer(16) = Join(words, " ")
      Answer(17) = Xzeros:      Answer(18) = Zreal:         Answer(19) = Zimag
      Answer(20) = Gain:       Answer(21) = LowestX_Y:     Answer(22) = maxX_Y
      For i = 1 To frmMain.PassData.Rows    ' find nFreqPoints value
         If Trim$(frmMain.PassData.TextMatrix(i, 1)) = "" Then nFreqPoints = i - 1: Exit For
         If Trim$(frmMain.PassData.TextMatrix(i, 2)) = "" Then nFreqPoints = i - 1: Exit For
         If Trim$(frmMain.PassData.TextMatrix(i, 3)) = "" Then nFreqPoints = i - 1: Exit For
      Next i
      Answer(mQuestions + 1) = str$(nFreqPoints)
      For i = 1 To frmMain.DelayData.Rows   ' find nDelayPts value
         If Trim$(frmMain.DelayData.TextMatrix(i, 1)) = "" Then nDelayPts = i - 1: Exit For
         If Trim$(frmMain.DelayData.TextMatrix(i, 2)) = "" Then nDelayPts = i - 1: Exit For
      Next i
      Answer(mQuestions + 2) = str$(nDelayPts)

      AnsNote1 = Note1:            AnsNote2 = Note2

'     Call PassExitCheck
      If nFreqPoints > 0 Then        'a Passband!
         nFreqPoints = PassData.Rows + 1
         ReDim Freq(1 To nFreqPoints), Yin(1 To nFreqPoints)
         ReDim Yout(1 To nFreqPoints)
         For i = 1 To nFreqPoints
           Freq(i) = Trim$(PassData.TextMatrix(i, 1))
           Yin(i) = Trim$(PassData.TextMatrix(i, 2))
           Yout(i) = Trim$(PassData.TextMatrix(i, 3))
           If Freq(i) = "" Then nFreqPoints = i - 1:    Exit For
           If Yin(i) = "" Then nFreqPoints = i - 1:    Exit For
           If Yout(i) = "" Then nFreqPoints = i - 1:    Exit For
         Next i
      Else
         ReDim Freq(1 To 1), Yin(1 To 1)
         ReDim Yout(1 To 1)
      End If

'     Call DelayExitCheck
      For i = 1 To frmMain.DelayData.Rows
          If Trim$(frmMain.DelayData.TextMatrix(i, 1)) = "" Then nDelayPts = i - 1: Exit For
      Next i
      If nDelayPts > 0 Then        'a Passband!
         nDelayPts = DelayData.Rows + 1
         ReDim DelFreq(1 To nDelayPts), tx(1 To nDelayPts)
         For i = 1 To nDelayPts
           DelFreq(i) = Trim$(DelayData.TextMatrix(i, 1))
           tx(i) = Trim$(DelayData.TextMatrix(i, 2))
           If DelFreq(i) = "" Then nDelayPts = i - 1:    Exit For
           If tx(i) = "" Then nDelayPts = i - 1:    Exit For
         Next i
      Else
         ReDim DelFreq(1 To 1), tx(1 To 1)
      End If

      Call PutSolvAnswers
      Count = 0
      For i = 1 To mSolv
         If SolvAnswer(i) = "" Then Count = Count + 1
      Next i
      If Count = mSolv Then
         mSolver = 0
      Else
         mSolver = mSolv
      End If
      Call SetCols4PassData
End Sub
Public Sub PutSolvAnswers()
      SolvAnswer(1) = Remax:     SolvAnswer(2) = Summary:    SolvAnswer(3) = Zero
      SolvAnswer(4) = StepsLim:  SolvAnswer(5) = StepOut:   SolvAnswer(6) = EvalMax
      SolvAnswer(7) = Bounds
End Sub
Private Sub ReSize_RTB()
        If ODE_Tabs.Tab = 8 Then
          If Me.Width > 10000 Then
            RichTextBox1.Width = Me.Width - 1650
          Else
            RichTextBox1.Width = Me.Width - 150
          End If
          RichTextBox1.RightMargin = RichTextBox1.Width - 650
          RichTextBox1.Height = Me.Height - 2200:   RichTextBox1.SetFocus
        End If
End Sub
Private Sub restoreTabStops()
        If Not restore Then
           If Not RunTime() Then MsgBox "TabStops -not- Stored!!", vbOKOnly:    End
        Else
           Dim i As Long        'resetting all tabStops
           If grid Is Nothing Then Exit Sub
           On Error Resume Next
           With grid.Parent
              For i = 1 To UBound(prntCntls)
                 If prntCntls(i).blnIsArray Then
                    .Controls(prntCntls(i).strName)(prntCntls(i).lngIndex).TabStop = prntCntls(i).blntabStop
                 Else
                    .Controls(prntCntls(i).strName).TabStop = prntCntls(i).blntabStop
                 End If
              Next
'above loop not working right; thus added this following code.
'           .Controls("A0initVal").TabStop = True
 '          .Controls("X0initVal").TabStop = True
  '         .Controls("YinitVals").TabStop = True
           End With
           ReDim prntCntls(0):      restore = False
        End If
End Sub
Private Sub RichTextBox1_KeyDown(KeyCode As Integer, Shift As Integer)
      If Shift = vbCtrlMask Then KeyCode = 0 'prevent copying text
      With RichTextBox1
        Select Case KeyCode
            Case vbKeyUp
                SendMessage .hwnd, WM_VSCROLL, SB_LINEUP, ByVal 0&
            Case vbKeyDown
                SendMessage .hwnd, WM_VSCROLL, SB_LINEDOWN, ByVal 0&
'           Case vbKeyPageUp
 '              SendMessage .hwnd, WM_VSCROLL, SB_PAGEUP, ByVal 0&
  '         Case vbKeyPageDown
   '            SendMessage .hwnd, WM_VSCROLL, SB_PAGEDOWN, ByVal 0&
'           Case vbKeyLeft
 '              SendMessage .hwnd, WM_HSCROLL, SB_LINELEFT, ByVal 0&
  '         Case vbKeyRight
   '            SendMessage .hwnd, WM_HSCROLL, SB_LINERIGHT, ByVal 0&
            Case vbKeyHome, vbKeyEnd
                KeyCode = 0
    '       Case Else
     '          KeyCode = 0
        End Select
      End With
End Sub
Private Sub saveTabStops()
'        If restore Then
 '         If Not RunTime() Then MsgBox "TabStops -not- reStored!!", vbOKOnly:    End
  '      Else
          Dim cntl As Control, i As Long   ' removing all tabStops
          On Error Resume Next
          With grid.Parent
             ReDim prntCntls(.Controls.Count)
             For Each cntl In .Controls
               i = i + 1:   prntCntls(i).blnIsArray = False
               If TypeName(.Controls(cntl.Name)) = "Object" Then
                 prntCntls(i).blnIsArray = True
                 prntCntls(i).lngIndex = cntl.Index
               End If
               prntCntls(i).strName = cntl.Name
               prntCntls(i).blntabStop = cntl.TabStop
               cntl.TabStop = False
             Next
          End With
           restore = True
   '     End If
End Sub
Private Sub SetColWidth()
      Dim Width As Long
      With PassData
          Width = .Width - .ColWidth(0) - 20
          .ColWidth(1) = Width / 4:          .ColWidth(2) = .ColWidth(1)
          .ColWidth(4) = .ColWidth(1):       .ColWidth(3) = Width - 3 * .ColWidth(1)
          .Width = 6910         'must do due to a bug when .width = 6815
      End With
      With DelayData
          Width = .Width - .ColWidth(0) - 20
          .ColWidth(1) = Width / 2:   .ColWidth(2) = Width - .ColWidth(1) - 30
          .Width = 5315
      End With
End Sub
Private Sub SetCols4PassData()
        PassData.Cols = 4 ':    PassData.Width = 6000
        FormatGrid
'       PassData.Refresh
End Sub
Private Sub setEnabled()
      nAllPoles.Enabled = True
      If Left$(Trim$(nAllPoles), 1) = "0" Then
         sigmaPoles.Enabled = False
      Else
         sigmaPoles.Enabled = True
      End If
      If chkSigmaZero.value = vbChecked Then
         chkLossless.Enabled = True:          chkDoublet.Enabled = True
         sigmaZero.Enabled = True
      Else
         chkLossless.Enabled = False:         chkDoublet.Enabled = False
         sigmaZero.Enabled = False
      End If
      If Val(nXzeros) = 0 Then
         Xzeros.Enabled = False
      Else
         Xzeros.Enabled = True
      End If
      If Val(nZpairs) + Val(nZquads) = 0 Then
         Zreal.Enabled = False:         Zimag.Enabled = False
      Else
         Zreal.Enabled = True:          Zimag.Enabled = True
      End If
End Sub
Private Sub SolvEnabled(onOff As Boolean)
        Remax.Enabled = onOff:      Summary.Enabled = onOff
 '    PreDamp.Enabled = onOff:    Damp.Enabled = onOff:    Delta.Enabled = onOff
        Zero.Enabled = onOff:    Bounds.Enabled = onOff
        EvalMax.Enabled = onOff:     StepOut.Enabled = onOff
                StepsLim.Enabled = onOff
End Sub
Sub ShowCellEditor(tb As TextBox)
        If ODE_Tabs.Tab <> 4 And ODE_Tabs.Tab <> 5 Then Exit Sub
        If ODE_Tabs.Tab = 4 And Not (tb Is txtPassCellEditor) Then Exit Sub
        If ODE_Tabs.Tab = 5 And Not (tb Is txtDelayCellEditor) Then Exit Sub
        saveTabStops
        With grid
          ' Cancel range selection, if any.
          .RowSel = .Row:      .ColSel = .Col
          ' Move the cell editor in place, by maing it one pixel smaller
          ' then the current cell.
          tb.Move .Left + .CellLeft, .Top + .CellTop, _
            .CellWidth - ScaleX(1, vbPixels, vbTwips), _
            .CellHeight - ScaleY(1, vbPixels, vbTwips)
          ' Transfer the contents of the current cell into the TextBox.
          tb.Text = .Text
          ' Move the textbox in front of the grid.
          tb.Visible = True
          tb.ZOrder
          tb.SetFocus
          ' Remember current coordinates for later.
          cellRow = .Row:        cellCol = .Col
        End With
End Sub
Public Sub ShowFilename()
      ' show the filename on the form's Caption
      Caption = ProgramName & ", a Calculus (level) program"
      Caption = IIf(fileIn = "", Caption, fileIn & " ... " & Caption)
End Sub
Private Sub txtPassCellEditor_GotFocus()
        If PassData.Row + 3 > PassData.Rows Then xyGridAddRow True
End Sub
Private Sub txtPassCellEditor_LostFocus()
        If UsingMouse = True Then
           UsingMouse = False:           Exit Sub
        End If
End Sub
Private Sub txtPassCellEditor_KeyPress(KeyAscii As Integer)
      Select Case KeyAscii
        Case 13, vbKeyTab  ' 9 = tab key
            KeyAscii = 0
        Case 27     ' ESC
            Call HideCellEditor(txtPassCellEditor, True)
      End Select
End Sub
Private Sub txtPassCellEditor_KeyDown(KeyCode As Integer, Shift As Integer)
      Select Case KeyCode
        Case 38      ' Up.
          Call MoveToCell(txtPassCellEditor, 2)
        Case 40      ' Down.
          Call MoveToCell(txtPassCellEditor, 1)
        Case 13, vbKeyTab  ' 9 = tab key
          With grid
            If Not (Shift And vbShiftMask) > 0 Then
               If .Col = .Cols - 1 Then
                  If .Rows = cellRow Then xyGridAddRow
                  .Col = 1:     .Row = .Row + 1
               ElseIf .Col < .Cols - 1 Then
                  .Col = .Col + 1
               End If
            Else    ' reverse direction
               If .Col = 1 And .Row > 1 Then
                  .Col = .Cols - 1: .Row = .Row - 1
               ElseIf .Col > 1 Then
                  .Col = .Col - 1
               End If
            End If
          End With
          Call MoveToCell(txtPassCellEditor, 0)
      End Select
End Sub
Private Sub txtDelayCellEditor_GotFocus()
        If DelayData.Row + 3 > DelayData.Rows Then xyGridAddRow True
End Sub
Private Sub txtDelayCellEditor_LostFocus()
        If UsingMouse = True Then
           UsingMouse = False:           Exit Sub
        End If
End Sub
Private Sub txtDelayCellEditor_KeyPress(KeyAscii As Integer)
      Select Case KeyAscii
        Case 13, vbKeyTab  ' 9 = tab key
            KeyAscii = 0
        Case 27     ' ESC
            Call HideCellEditor(txtDelayCellEditor, True)
      End Select
End Sub
Private Sub txtDelayCellEditor_KeyDown(KeyCode As Integer, Shift As Integer)
      Select Case KeyCode
        Case 38      ' Up.
          Call MoveToCell(txtDelayCellEditor, 2)
        Case 40      ' Down.
          Call MoveToCell(txtDelayCellEditor, 1)
        Case 13, vbKeyTab  ' 9 = tab key
          With grid
            If Not (Shift And vbShiftMask) > 0 Then
               If .Col = .Cols - 1 Then
                  If .Rows = cellRow Then xyGridAddRow
                  .Col = 1:     .Row = .Row + 1
               ElseIf .Col < .Cols - 1 Then
                  .Col = .Col + 1
               End If
            Else    ' reverse direction
               If .Col = 1 And .Row > 1 Then
                  .Col = .Cols - 1: .Row = .Row - 1
               ElseIf .Col > 1 Then
                  .Col = .Col - 1
               End If
            End If
          End With
          Call MoveToCell(txtDelayCellEditor, 0)
      End Select
End Sub
Private Sub MoveToCell(tb As TextBox, varMoveBehaviour As Integer)
      Call HideCellEditor(tb)
      With grid
        Select Case varMoveBehaviour
          Case 0       'edit none
            .SetFocus
            Call ShowCellEditor(tb)
          Case 1       'move down
            If .Row + 3 > .Rows Then xyGridAddRow
            .Row = .Row + 1
            Call ShowCellEditor(tb)
          Case 2       'Move Up
            If .Row > 1 Then .Row = .Row - 1
            Call ShowCellEditor(tb)
        End Select
      End With
End Sub
Private Sub DelayData_Click()
        Set grid = DelayData
        Call ShowCellEditor(txtDelayCellEditor)
End Sub
Private Sub DelayData_KeyPress(KeyAscii As Integer)
      Set grid = DelayData
      Call ShowCellEditor(txtDelayCellEditor)
      ' If it's an alphanumeric key, it is passed to the TextBox.
      If KeyAscii >= 32 Then
        txtDelayCellEditor.Text = Chr$(KeyAscii):    isDirty = True
        txtDelayCellEditor.SelStart = 1:     txtDelayCellEditor.SelLength = 9999
      End If
End Sub
Private Sub DelayData_MouseDown(Button As Integer, Shift As Integer, _
                                  x As Single, y As Single)
      UsingMouse = True
      Set grid = DelayData
      Call HideCellEditor(txtDelayCellEditor)
      If restore Then restoreTabStops
End Sub
Private Sub PassData_Click()
        Set grid = PassData
        Call ShowCellEditor(txtPassCellEditor)
End Sub
Private Sub PassData_KeyPress(KeyAscii As Integer)
      Set grid = PassData
      Call ShowCellEditor(txtPassCellEditor)
      ' If it's an alphanumeric key, it is passed to the TextBox.
      If KeyAscii >= 32 Then
        txtPassCellEditor.Text = Chr$(KeyAscii):    isDirty = True
        txtPassCellEditor.SelStart = 1:     txtPassCellEditor.SelLength = 9999
      End If
End Sub
Private Sub PassData_MouseDown(Button As Integer, Shift As Integer, _
                                  x As Single, y As Single)
      UsingMouse = True
      Set grid = PassData
      Call HideCellEditor(txtPassCellEditor)
      If restore Then restoreTabStops
End Sub
Private Sub xyGridAddRow(Optional cancel As Boolean)
        Dim wCol1 As Long, wCol2 As Long, wCol3 As Long, wCol4 As Long
        If grid Is PassData Then
           With PassData
             wCol1 = .ColWidth(1):    wCol2 = .ColWidth(2):      wCol3 = .ColWidth(3)
             .Rows = .Rows + 1:      .FixedRows = 1:      isDirty = True
             If cancel Then Call FormatGrid
             .ColWidth(1) = wCol1:    .ColWidth(2) = wCol2
             .ColWidth(3) = wCol3
           End With
        Else
           With DelayData
             wCol1 = .ColWidth(1):    wCol2 = .ColWidth(2)
             .Rows = .Rows + 1:      .FixedRows = 1:      isDirty = True
             If cancel Then Call FormatGrid
             .ColWidth(1) = wCol1:    .ColWidth(2) = wCol2
           End With
        End If
End Sub
