VERSION 5.00 Begin VB.Form frmReplaces BorderStyle = 3 'Fixed Dialog Caption = " Edit Replace Definitions" ClientHeight = 3390 ClientLeft = 45 ClientTop = 330 ClientWidth = 4095 Icon = "frmReplaces.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 3390 ScaleWidth = 4095 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton cbOkay Caption = "&OK" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 2520 TabIndex = 4 Top = 2730 Width = 1470 End Begin VB.CommandButton cbNew Caption = "&Add" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 2520 TabIndex = 3 Top = 315 Width = 1470 End Begin VB.CommandButton cbDelete Caption = "&Delete" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 2520 TabIndex = 2 Top = 765 Width = 1470 End Begin VB.ListBox lbReps BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF0000& Height = 2790 ItemData = "frmReplaces.frx":08CA Left = 120 List = "frmReplaces.frx":08CC Sorted = -1 'True TabIndex = 0 Top = 300 Width = 2310 End Begin VB.Label Label3 Caption = "Replace" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 150 TabIndex = 1 Top = 60 Width = 1125 End End Attribute VB_Name = "frmReplaces" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub cbDelete_Click() If lbReps.Text = "" Then MsgBox "Select a replace definition to delete.", vbCritical, "Delete Replace Definition" Exit Sub End If inf.Modules("Main").Replaces.Remove lbReps.Text lbReps.RemoveItem lbReps.ListIndex End Sub Private Sub cbNew_Click() Dim newrep As String TryAgain: newrep = InputBox("Enter a replacement procedure name:", "Add Replace Definition") If isBlank(newrep) Then Exit Sub ElseIf Not LCase(Left(newrep, 1)) Like "[a-z]" Then MsgBox "Procedure must begin with A to Z." & vbCrLf & "(case insensitive)", vbExclamation, "New Replace Definition" Exit Sub Else For lChar = 1 To Len(newrep) sChar = Mid(newrep, lChar, 1) If Not sChar Like "[_0-9A-Za-z]" Then MsgBox "Procedure may only contain 0 to 9, underscore, or A to Z." & vbCrLf & "(case insensitive)", vbExclamation, "New Replace Definition" Exit Sub End If Next lChar End If If inf.Modules("Main").Replaces.Find(newrep) > 0 Then MsgBox "Replace definition already exists.", vbExclamation, "New Replace Definition" Exit Sub End If inf.Modules("Main").Replaces.Add newrep lbReps.AddItem newrep End Sub Private Sub cbOkay_Click() Unload Me End Sub Private Sub Form_Load() Dim rep As infNameDef For Each rep In inf.Modules("Main").Replaces lbReps.AddItem rep.Name Next End Sub