VERSION 5.00 Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX" Begin VB.Form frmGlobals BorderStyle = 3 'Fixed Dialog Caption = " Edit Globals" ClientHeight = 3975 ClientLeft = 45 ClientTop = 330 ClientWidth = 9165 Icon = "frmGlobals.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 3975 ScaleWidth = 9165 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton cbDelete Caption = "&Delete" Enabled = 0 'False BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 7545 TabIndex = 5 Top = 240 Width = 1470 End Begin VB.CommandButton cbRename Caption = "&Rename" Enabled = 0 'False BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 5565 TabIndex = 4 Top = 240 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 = 3585 TabIndex = 3 Top = 240 Width = 1470 End 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 = 7545 TabIndex = 2 Top = 3540 Width = 1470 End Begin VB.ComboBox lbGlobals BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF0000& Height = 315 ItemData = "frmGlobals.frx":08CA Left = 120 List = "frmGlobals.frx":08CC TabIndex = 0 Top = 270 Width = 3165 End Begin RichTextLib.RichTextBox txtValue Height = 2790 Left = 105 TabIndex = 1 Top = 690 Width = 8910 _ExtentX = 15716 _ExtentY = 4921 _Version = 393217 Enabled = 0 'False ScrollBars = 2 DisableNoScroll = -1 'True TextRTF = $"frmGlobals.frx":08CE BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Courier New" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty End Begin VB.Label Label3 Caption = "Globals" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 135 TabIndex = 6 Top = 60 Width = 1125 End End Attribute VB_Name = "frmGlobals" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub Form_Load() Dim glob As infNameValueDef lbGlobals.Clear For Each glob In inf.Modules("Main").Globals lbGlobals.AddItem glob.Name Next End Sub Private Sub cbDelete_Click() Dim upCount As Long Dim cont As String cont = MsgBox("Do you wish to delete the global '" & lbGlobals.Text & "'?", vbYesNoCancel, "Delete Global") If cont = vbYes Then inf.Modules("Main").Globals.Remove lbGlobals.Text lbGlobals.RemoveItem lbGlobals.ListIndex End If End Sub Private Sub cbNew_Click() Dim newglob As String newglob = InputBox("Enter a new global name:", "Add Global Definition") If isBlank(newglob) Then Exit Sub ElseIf Not LCase(Left(newglob, 1)) Like "[a-z]" Then MsgBox "Global must begin with A to Z." & vbCrLf & "(case insensitive)", vbExclamation, "New Global" Exit Sub Else For lChar = 1 To Len(newglob) sChar = Mid(newglob, lChar, 1) If Not sChar Like "[_0-9A-Za-z]" Then MsgBox "Global may only contain 0 to 9, underscore, or A to Z." & vbCrLf & "(case insensitive)", vbExclamation, "New Global" Exit Sub End If Next lChar End If If inf.Modules("Main").Globals.Find(newglob) > 0 Then MsgBox "Global already exists.", vbExclamation, "New Global" Exit Sub End If inf.Modules("Main").Globals.Add newglob, "" lbGlobals.AddItem newglob lbGlobals.ListIndex = lbGlobals.NewIndex End Sub Private Sub cbOkay_Click() Unload Me End Sub Private Sub cbRename_Click() Dim yn As String Dim newglob As String newglob = InputBox("Rename '" & lbGlobals.Text & "' to:", "Rename Global") If isBlank(newglob) Then Exit Sub ElseIf Not LCase(Left(newglob, 1)) Like "[a-z]" Then MsgBox "Property must begin with A to Z." & vbCrLf & "(case insensitive)", vbExclamation, "Rename Global" Exit Sub Else For lChar = 1 To Len(newglob) sChar = Mid(newglob, lChar, 1) If Not sChar Like "[_0-9A-Za-z]" Then MsgBox "Property may only contain 0 to 9, underscore, or A to Z." & vbCrLf & "(case insensitive)", vbExclamation, "Rename Global" Exit Sub End If Next lChar End If If inf.Modules("Main").Globals.Find(newglob) > 0 Then MsgBox "Global already exists.", vbExclamation, "Rename Global" Exit Sub End If yn = MsgBox("Rename '" & lbGlobals.Text & "' to '" & newglob & "'?", vbYesNoCancel, "Rename Global") If yn = vbYes Then inf.Modules("Main").Globals.Add newglob, "" Set inf.Modules("Main").Globals(newglob).Comments = inf.Modules("Main").Globals(lbGlobals.Text).Comments inf.Modules("Main").Globals.Remove lbGlobals.Text Form_Load End If End Sub Private Sub lbGlobals_Click() cbRename.Enabled = True cbDelete.Enabled = True txtValue.Enabled = True txtValue.Text = inf.Modules("Main").Globals(lbGlobals.Text).Value txtValue.SetFocus End Sub Private Sub txtValue_LostFocus() inf.Modules("Main").Globals(lbGlobals.Text).Value = txtValue.Text txtValue = "" End Sub