VERSION 5.00 Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX" Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX" Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX" Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL" Object = "{72D18DD4-0DA7-11D2-8E21-00B404C10000}#2.1#0"; "ODCboLst.ocx" Begin VB.Form frmMain Caption = "Visual Inform" ClientHeight = 7890 ClientLeft = 60 ClientTop = 630 ClientWidth = 11880 Icon = "frmMain.frx":0000 LinkTopic = "Form1" ScaleHeight = 32.875 ScaleMode = 4 'Character ScaleWidth = 99 StartUpPosition = 2 'CenterScreen Begin MSComctlLib.StatusBar statusbar Align = 2 'Align Bottom Height = 345 Left = 0 TabIndex = 50 Top = 7545 Width = 11880 _ExtentX = 20955 _ExtentY = 609 Style = 1 _Version = 393216 BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} NumPanels = 1 BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} EndProperty EndProperty BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty End Begin VB.CommandButton cbDelParentName DownPicture = "frmMain.frx":08CA Height = 315 Left = 9165 Picture = "frmMain.frx":09CC Style = 1 'Graphical TabIndex = 47 ToolTipText = "Remove Parent Reference" Top = 2610 Width = 330 End Begin VB.CommandButton cbDelClassName DownPicture = "frmMain.frx":0ACE Height = 315 Left = 9165 Picture = "frmMain.frx":0BD0 Style = 1 'Graphical TabIndex = 46 ToolTipText = "Remove Class Reference" Top = 1875 Width = 330 End Begin RichTextLib.RichTextBox txtCode Height = 3300 Left = 60 TabIndex = 3 TabStop = 0 'False Top = 3660 Width = 11745 _ExtentX = 20717 _ExtentY = 5821 _Version = 393217 BackColor = 16777215 Enabled = -1 'True ScrollBars = 2 DisableNoScroll = -1 'True AutoVerbMenu = -1 'True TextRTF = $"frmMain.frx":0CD2 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.CheckBox chkPrivate Caption = "Private" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 1260 TabIndex = 45 Top = 2385 Width = 1035 End Begin VB.CommandButton cbDelProp DownPicture = "frmMain.frx":0D52 Height = 315 Left = 4395 Picture = "frmMain.frx":0E54 Style = 1 'Graphical TabIndex = 44 ToolTipText = "Delete Property" Top = 2610 Width = 330 End Begin VB.TextBox txtShortName BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF0000& Height = 345 Left = 75 TabIndex = 38 Top = 1875 Width = 4650 End Begin VB.Frame Frame1 Caption = "Selector" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF0000& Height = 1545 Left = 60 TabIndex = 25 Top = 30 Width = 6315 Begin VB.CommandButton cbDelProc DownPicture = "frmMain.frx":0F56 Height = 315 Left = 5850 Picture = "frmMain.frx":1058 Style = 1 'Graphical TabIndex = 43 ToolTipText = "Delete Procedure" Top = 1080 Width = 330 End Begin VB.CommandButton cbDelObj DownPicture = "frmMain.frx":115A Height = 315 Left = 5850 Picture = "frmMain.frx":125C Style = 1 'Graphical TabIndex = 42 ToolTipText = "Delete Object" Top = 660 Width = 330 End Begin VB.CommandButton cbDelClass DownPicture = "frmMain.frx":135E Height = 315 Left = 5850 Picture = "frmMain.frx":1460 Style = 1 'Graphical TabIndex = 41 ToolTipText = "Delete Class" Top = 240 Width = 330 End Begin VB.CommandButton cbAddProc DownPicture = "frmMain.frx":1562 Height = 315 Left = 5475 Picture = "frmMain.frx":1664 Style = 1 'Graphical TabIndex = 37 ToolTipText = "Create New Procedure" Top = 1080 Width = 330 End Begin VB.CommandButton cbAddClass DownPicture = "frmMain.frx":1766 Height = 315 Left = 5475 Picture = "frmMain.frx":1868 Style = 1 'Graphical TabIndex = 36 ToolTipText = "Create New Class" Top = 240 Width = 330 End Begin VB.CommandButton cbAddObject DownPicture = "frmMain.frx":196A Height = 315 Left = 5475 Picture = "frmMain.frx":1A6C Style = 1 'Graphical TabIndex = 35 ToolTipText = "Create New Object" Top = 660 Width = 330 End Begin ODCboLst.OwnerDrawComboList cbObjects Height = 360 Left = 1185 TabIndex = 26 Top = 645 Width = 4260 _ExtentX = 7514 _ExtentY = 635 Sorted = -1 'True DropDownWidth = 400 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483630 MaxLength = 0 End Begin ODCboLst.OwnerDrawComboList cbClasses Height = 360 Left = 1185 TabIndex = 27 Top = 225 Width = 4260 _ExtentX = 7514 _ExtentY = 635 Sorted = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483630 MaxLength = 0 End Begin ODCboLst.OwnerDrawComboList cbProc Height = 360 Left = 1185 TabIndex = 28 Top = 1050 Width = 4260 _ExtentX = 7514 _ExtentY = 635 Sorted = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483630 MaxLength = 0 End Begin VB.Label Label5 Caption = "Procedure" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 105 TabIndex = 31 Top = 1125 Width = 990 End Begin VB.Label Label4 Caption = "Object" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 105 TabIndex = 30 Top = 720 Width = 765 End Begin VB.Label Label3 Caption = "Class" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 105 TabIndex = 29 Top = 315 Width = 765 End End Begin MSComctlLib.ProgressBar pbLoad Height = 375 Left = 4815 TabIndex = 23 Top = 7050 Visible = 0 'False Width = 7005 _ExtentX = 12356 _ExtentY = 661 _Version = 393216 Appearance = 1 End Begin MSComDlg.CommonDialog cdFile Left = 8685 Top = 1050 _ExtentX = 847 _ExtentY = 847 _Version = 393216 CancelError = -1 'True DefaultExt = "inf" DialogTitle = "Open Inform File" Filter = "Inform File (*.inf)|*.inf|All Files (*.*)|*.*" End Begin VB.Frame fmDir Caption = "Navigator" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF0000& Height = 1545 Left = 6435 TabIndex = 0 Top = 30 Width = 5370 Begin MSForms.CommandButton cbDir Height = 375 Index = 2 Left = 1590 TabIndex = 34 Top = 660 Width = 615 ForeColor = 16711680 Caption = "E" Size = "1085;661" FontName = "Verdana" FontEffects = 1073741825 FontHeight = 165 FontCharSet = 0 FontPitchAndFamily= 2 ParagraphAlign = 3 FontWeight = 700 End Begin MSForms.CommandButton cbDir Height = 375 Index = 9 Left = 3915 TabIndex = 33 Top = 645 Width = 1110 ForeColor = 16711680 Caption = "Out" Size = "1958;661" FontName = "Verdana" FontEffects = 1073741825 FontHeight = 165 FontCharSet = 0 FontPitchAndFamily= 2 ParagraphAlign = 3 FontWeight = 700 End Begin MSForms.CommandButton cbDir Height = 375 Index = 11 Left = 2745 TabIndex = 32 Top = 645 Width = 1110 ForeColor = 16711680 Caption = "Down" Size = "1958;661" FontName = "Verdana" FontEffects = 1073741825 FontHeight = 165 FontCharSet = 0 FontPitchAndFamily= 2 ParagraphAlign = 3 FontWeight = 700 End Begin MSForms.CommandButton cbDir Height = 375 Index = 12 Left = 3315 TabIndex = 14 Top = 1080 Width = 1110 ForeColor = 16711680 Caption = "Can't Go" Size = "1958;661" FontName = "Verdana" FontEffects = 1073741825 FontHeight = 165 FontCharSet = 0 FontPitchAndFamily= 2 ParagraphAlign = 3 FontWeight = 700 End Begin MSForms.CommandButton cbDir Height = 375 Index = 10 Left = 2745 TabIndex = 13 Top = 240 Width = 1110 ForeColor = 16711680 Caption = "Up" Size = "1958;661" FontName = "Verdana" FontEffects = 1073741825 FontHeight = 165 FontCharSet = 0 FontPitchAndFamily= 2 ParagraphAlign = 3 FontWeight = 700 End Begin MSForms.CommandButton cbDir Height = 375 Index = 8 Left = 3915 TabIndex = 12 Top = 240 Width = 1110 ForeColor = 16711680 Caption = "In" Size = "1958;661" FontName = "Verdana" FontEffects = 1073741825 FontHeight = 165 FontCharSet = 0 FontPitchAndFamily= 2 ParagraphAlign = 3 FontWeight = 700 End Begin MSForms.CommandButton cbDir Height = 375 Index = 7 Left = 270 TabIndex = 11 Top = 255 Width = 615 ForeColor = 16711680 Caption = "NW" Size = "1085;661" FontName = "Verdana" FontEffects = 1073741825 FontHeight = 165 FontCharSet = 0 FontPitchAndFamily= 2 ParagraphAlign = 3 FontWeight = 700 End Begin MSForms.CommandButton cbDir Height = 375 Index = 6 Left = 270 TabIndex = 10 Top = 660 Width = 615 ForeColor = 16711680 Caption = "W" Size = "1085;661" FontName = "Verdana" FontEffects = 1073741825 FontHeight = 165 FontCharSet = 0 FontPitchAndFamily= 2 ParagraphAlign = 3 FontWeight = 700 End Begin MSForms.CommandButton cbDir Height = 375 Index = 5 Left = 270 TabIndex = 9 Top = 1065 Width = 615 ForeColor = 16711680 Caption = "SW" Size = "1085;661" FontName = "Verdana" FontEffects = 1073741825 FontHeight = 165 FontCharSet = 0 FontPitchAndFamily= 2 ParagraphAlign = 3 FontWeight = 700 End Begin MSForms.CommandButton cbDir Height = 375 Index = 4 Left = 930 TabIndex = 8 Top = 1065 Width = 615 ForeColor = 16711680 Caption = "S" Size = "1085;661" FontName = "Verdana" FontEffects = 1073741825 FontHeight = 165 FontCharSet = 0 FontPitchAndFamily= 2 ParagraphAlign = 3 FontWeight = 700 End Begin MSForms.CommandButton cbDir Height = 375 Index = 3 Left = 1590 TabIndex = 7 Top = 1065 Width = 615 ForeColor = 16711680 Caption = "SE" Size = "1085;661" FontName = "Verdana" FontEffects = 1073741825 FontHeight = 165 FontCharSet = 0 FontPitchAndFamily= 2 ParagraphAlign = 3 FontWeight = 700 End Begin MSForms.CommandButton cbDir Height = 375 Index = 1 Left = 1590 TabIndex = 6 Top = 255 Width = 615 ForeColor = 16711680 Caption = "NE" Size = "1085;661" FontName = "Verdana" FontEffects = 1073741825 FontHeight = 165 FontCharSet = 0 FontPitchAndFamily= 2 ParagraphAlign = 3 FontWeight = 700 End Begin MSForms.CommandButton cbDir Height = 375 Index = 0 Left = 930 TabIndex = 5 Top = 255 Width = 615 ForeColor = 16711680 Caption = "N" Size = "1085;661" FontName = "Verdana" FontEffects = 1073741825 FontHeight = 165 FontCharSet = 0 FontPitchAndFamily= 2 ParagraphAlign = 3 FontWeight = 700 End End Begin ODCboLst.OwnerDrawComboList cbProps Height = 360 Left = 75 TabIndex = 4 Top = 2595 Width = 4275 _ExtentX = 7541 _ExtentY = 635 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Verdana" Size = 9 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483630 MaxLength = 0 End Begin ODCboLst.OwnerDrawComboList cbClassName Height = 360 Left = 4800 TabIndex = 16 Top = 1860 Width = 4320 _ExtentX = 7620 _ExtentY = 635 Sorted = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483630 MaxLength = 0 End Begin ODCboLst.OwnerDrawComboList cbParentName Height = 360 Left = 4800 TabIndex = 17 Top = 2595 Width = 4320 _ExtentX = 7620 _ExtentY = 635 Sorted = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483630 MaxLength = 0 End Begin VB.TextBox txtArguments BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF0000& Height = 345 Left = 75 TabIndex = 20 Top = 3270 Width = 4230 End Begin ODCboLst.OwnerDrawComboList cbAttribs Height = 1755 Left = 9600 TabIndex = 22 Top = 1860 Width = 2190 _ExtentX = 3863 _ExtentY = 3096 Sorted = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483630 Style = 5 FullRowSelect = -1 'True MaxLength = 0 End Begin ODCboLst.OwnerDrawComboList cbPropertyType Height = 360 Left = 4800 TabIndex = 48 Top = 3255 Width = 4320 _ExtentX = 7620 _ExtentY = 635 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483630 Enabled = 0 'False MaxLength = 0 End Begin VB.Label lblPropType Caption = "Property Type" 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 = 195 Left = 4815 TabIndex = 49 Top = 3060 Width = 1695 End Begin VB.Label lblSN2 Alignment = 1 'Right Justify Caption = "(short_name property overrides)" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 1425 TabIndex = 40 Top = 1665 Width = 2865 End Begin VB.Label lblSN1 Caption = "Short Name" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 90 TabIndex = 39 Top = 1665 Width = 1185 End Begin VB.Label lblStatus Alignment = 1 'Right Justify BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF0000& Height = 195 Left = 2355 TabIndex = 24 Top = 7125 Visible = 0 'False Width = 2370 End Begin MSForms.CommandButton cbResize Height = 390 Left = 60 TabIndex = 21 Top = 7020 Width = 2205 VariousPropertyBits= 25 Caption = "(click for full screen)" Size = "3889;688" FontEffects = 1073750016 FontHeight = 165 FontCharSet = 0 FontPitchAndFamily= 2 ParagraphAlign = 3 End Begin VB.Label lblArguments Caption = "Arguments" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 90 TabIndex = 19 Top = 3060 Width = 1185 End Begin VB.Label lblParentName Caption = "Parent Name ->" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 4815 TabIndex = 18 Top = 2400 Width = 1695 End Begin VB.Label lblClassName Caption = "Class Name" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 4815 TabIndex = 15 Top = 1665 Width = 1440 End Begin VB.Label lblAttribs Caption = "Attributes" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 9585 TabIndex = 2 Top = 1665 Width = 1140 End Begin VB.Label lblProps Caption = "Properties" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 90 TabIndex = 1 Top = 2385 Width = 1080 End Begin VB.Menu mnuFile Caption = "&File" Begin VB.Menu mnuFileNew Caption = "&New" End Begin VB.Menu mnuFileOpen Caption = "&Open" End Begin VB.Menu mnuFileSave Caption = "&Save" Visible = 0 'False End Begin VB.Menu mnuFileSaveAs Caption = "Save &As" Visible = 0 'False End Begin VB.Menu mnuFileClose Caption = "&Close" Visible = 0 'False End Begin VB.Menu mnuExit Caption = "E&xit" End Begin VB.Menu mnuFileSep Caption = "-" Visible = 0 'False End Begin VB.Menu mnuOpenFile1 Caption = "&1 File1" Visible = 0 'False End Begin VB.Menu mnuOpenFile2 Caption = "&2 File2" Visible = 0 'False End Begin VB.Menu mnuOpenFile3 Caption = "&3 File3" Visible = 0 'False End Begin VB.Menu mnuOpenFile4 Caption = "&4 File4" Visible = 0 'False End End Begin VB.Menu mnuEdit Caption = "&Edit" Visible = 0 'False Begin VB.Menu mnuEditProps Caption = "&PropertyDefs" End Begin VB.Menu mnuEditAttribs Caption = "&AttributeDefs" End Begin VB.Menu mnuEditGrammar Caption = "&Grammar" End Begin VB.Menu mnuEditConstants Caption = "&Constants" End Begin VB.Menu mnuEditGlobals Caption = "&Globals" End Begin VB.Menu mnuEditArrays Caption = "&Arrays" End Begin VB.Menu mnuEditReplace Caption = "&ReplaceDefs" End End Begin VB.Menu mnuInform Caption = "&Inform" Visible = 0 'False Begin VB.Menu mnuCompile Caption = "&Compile" End Begin VB.Menu mnuPlay Caption = "&Play" End End Begin VB.Menu mnuSet Caption = "&Set" Visible = 0 'False Begin VB.Menu mnuSack Caption = "Sac&k Object" Visible = 0 'False End Begin VB.Menu mnuReplace Caption = "&Replace" Visible = 0 'False End Begin VB.Menu mnusep3 Caption = "-" Visible = 0 'False End Begin VB.Menu mnuGSettings Caption = "&Game Settings" End Begin VB.Menu mnuSettings Caption = "&Compiler Settings" End End Begin VB.Menu mnuHelp Caption = "&Help" Begin VB.Menu mnuHelpDMan Caption = "&Designer's Manual" End Begin VB.Menu mnuAbout 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 Private isLoaded As Boolean Private isObject As Boolean ' false = class Private MainDirs(0 To 12) As String Private sCurrentFilename As String Private sOpenFilename As String Public sFilename As String Private bSaveAs As Boolean Private Sub cbAddClass_Click() frmNewClass.Show 1 End Sub Private Sub cbAddObject_Click() frmNewObject.Show 1 End Sub Private Sub cbAddProc_Click() frmNewProc.Show 1 End Sub Private Sub cbAttribs_Click() Dim attr As infAttribute Dim lIndex As Long Dim sAttr As String If isObject Then With frmMain.cbObjects lIndex = .ItemData(.ListIndex) sAttr = frmMain.cbAttribs.Text If inf.Modules("Main").Objects(lIndex).Attributes.Find(sAttr) = 0 Then inf.Modules("Main").Objects(lIndex).Attributes.Add sAttr, True Else inf.Modules("Main").Objects(lIndex).Attributes(sAttr).Value = Not inf.Modules("Main").Objects(lIndex).Attributes(sAttr).Value End If End With Else With frmMain.cbClasses lIndex = .ItemData(.ListIndex) sAttr = frmMain.cbAttribs.Text If inf.Modules("Main").Classes(lIndex).Attributes.Find(sAttr) = 0 Then inf.Modules("Main").Classes(lIndex).Attributes.Add sAttr, True Else inf.Modules("Main").Classes(lIndex).Attributes(sAttr).Value = Not inf.Modules("Main").Classes(lIndex).Attributes(sAttr).Value End If End With End If End Sub Private Sub cbClasses_Click() Dim prop As infProperty Dim lIndex As Long Dim PIndex As Long If frmMain.cbClasses.ListIndex = -1 Then If cbClasses.ListCount = 0 Then frmMain.cbClassName.Enabled = False frmMain.lblClassName.Enabled = False End If Exit Sub End If isObject = False SetControls True frmMain.cbObjects.ListIndex = -1 frmMain.cbPropertyType.ListIndex = -1 frmMain.cbPropertyType.Enabled = False frmMain.lblPropType.Enabled = False lIndex = frmMain.cbClasses.ItemData(frmMain.cbClasses.ListIndex) ResetProperties inf.Modules("Main").Classes(lIndex).Properties ResetAttributes inf.Modules("Main").Classes(lIndex).Attributes frmMain.txtCode = "" frmMain.txtArguments = "" frmMain.txtShortName = "" If inf.Modules("Main").Classes(lIndex).ClassName <> "" Then frmMain.cbClassName.ListIndex = frmMain.cbClassName.FindItemIndex(inf.Modules("Main").Classes(lIndex).ClassName, True) frmMain.cbDelClassName.Enabled = True Else frmMain.cbClassName.ListIndex = -1 frmMain.cbDelClassName.Enabled = False End If ' ' Classes cannot have a parent ' frmMain.cbParentName.Enabled = False frmMain.lblParentName.Enabled = False frmMain.txtShortName.Enabled = False frmMain.lblSN1.Enabled = False frmMain.lblSN2.Enabled = False frmMain.cbProc.ListIndex = -1 frmMain.cbDelClass.Enabled = True frmMain.cbDelObj.Enabled = False frmMain.cbDelProc.Enabled = False frmMain.cbDelProp.Enabled = False frmMain.cbProps.Enabled = True frmMain.chkPrivate.Enabled = False frmMain.mnuSack.Visible = False frmMain.mnusep3.Visible = False frmMain.mnuReplace.Visible = False txtCode.Enabled = False txtArguments.Enabled = False lblArguments.Enabled = False cbResize.Enabled = False SetDirections False End Sub Private Sub cbClassName_Click() If frmMain.cbClassName.ListIndex = -1 Then Exit Sub If frmMain.cbClasses.Text = frmMain.cbClassName.Text And frmMain.cbClassName.Text <> "" Then MsgBox "Invalid circular reference.", vbExclamation, "Select Class" frmMain.cbClassName.ListIndex = -1 Else If isObject Then inf.Modules("Main").Objects(cbObjects.Text).ClassName = cbClassName.Text Else inf.Modules("Main").Classes(cbClasses.Text).ClassName = cbClassName.Text End If frmMain.cbDelClassName.Enabled = True End If End Sub Private Sub cbDelClass_Click() Dim yn As String Dim sName As String yn = MsgBox("Do you really wish to delete the class '" & frmMain.cbClasses.Text & "'?", vbYesNoCancel, "Delete Class") If yn = vbYes Then sName = frmMain.cbClasses.Text inf.Modules("Main").Classes.Remove sName frmMain.cbClasses.RemoveItem frmMain.cbClasses.ListIndex frmMain.cbClassName.RemoveItem frmMain.cbClassName.FindItemIndex(sName, True) frmMain.cbAttribs.Clear frmMain.cbProps.Clear frmMain.txtArguments.Text = "" frmMain.txtShortName.Text = "" frmMain.txtCode.Text = "" frmMain.cbClassName.ListIndex = -1 frmMain.cbDelClass.Enabled = False frmMain.cbDelProp.Enabled = False frmMain.cbClasses.ListIndex = -1 frmMain.cbClassName.ListIndex = -1 frmMain.chkPrivate.Enabled = False End If End Sub Private Sub cbDelClassName_Click() If isObject Then inf.Modules("Main").Objects(cbObjects.Text).ClassName = "" Else inf.Modules("Main").Classes(cbClasses.Text).ClassName = "" End If cbClassName.ListIndex = -1 cbDelClassName.Enabled = False End Sub Private Sub cbDelObj_Click() Dim yn As String Dim sName As String yn = MsgBox("Do you really wish to delete the object '" & frmMain.cbObjects.Text & "'?", vbYesNoCancel, "Delete Object") If yn = vbYes Then sName = frmMain.cbObjects.Text inf.Modules("Main").Objects.Remove sName frmMain.cbObjects.RemoveItem frmMain.cbObjects.ListIndex frmMain.cbParentName.RemoveItem frmMain.cbParentName.FindItemIndex(sName, True) frmMain.cbAttribs.Clear frmMain.cbProps.Clear frmMain.txtArguments.Text = "" frmMain.txtShortName.Text = "" frmMain.txtCode.Text = "" frmMain.cbClassName.ListIndex = -1 frmMain.cbDelObj.Enabled = False frmMain.cbDelProp.Enabled = False frmMain.cbObjects.ListIndex = -1 frmMain.cbParentName.ListIndex = -1 frmMain.cbClassName.ListIndex = -1 frmMain.chkPrivate.Enabled = False End If End Sub Private Sub cbDelParentName_Click() inf.Modules("Main").Objects(cbObjects.Text).ParentName = "" cbDelParentName.Enabled = False cbParentName.ListIndex = -1 End Sub Private Sub cbDelProc_Click() Dim yn As String Dim sName As String yn = MsgBox("Do you really wish to delete the procedure '" & frmMain.cbProc.Text & "'?", vbYesNoCancel, "Delete Procedure") If yn = vbYes Then sName = frmMain.cbProc.Text inf.Modules("Main").Procedures.Remove sName frmMain.cbProc.RemoveItem frmMain.cbProc.ListIndex frmMain.cbProc.ListIndex = -1 frmMain.txtArguments = "" frmMain.txtCode = "" frmMain.cbDelProc.Enabled = False End If End Sub Private Sub cbDelProp_Click() If cbObjects.Text <> "" Then inf.Modules("Main").Objects(cbObjects.Text).Properties.Remove cbProps.Text ResetProperties inf.Modules("Main").Objects(cbObjects.Text).Properties Else inf.Modules("Main").Classes(cbClasses.Text).Properties.Remove cbProps.Text ResetProperties inf.Modules("Main").Classes(cbClasses.Text).Properties End If txtArguments.Text = "" txtCode.Text = "" cbDelProp.Enabled = False lblArguments.Enabled = False txtArguments.Enabled = False txtCode.Enabled = False End Sub Private Sub cbDir_Click(Index As Integer) cbObjects.ListIndex = cbObjects.FindItemIndex(MainDirs(Index), True) End Sub Private Sub cbObjects_Click() Dim prop As infProperty Dim lIndex As Long Dim PIndex As Long Dim dIndex As Long If frmMain.cbObjects.ListIndex = -1 Then Exit Sub isObject = True SetControls True frmMain.cbClasses.ListIndex = -1 frmMain.cbPropertyType.ListIndex = -1 frmMain.cbPropertyType.Enabled = False frmMain.lblPropType.Enabled = False lIndex = frmMain.cbObjects.ItemData(frmMain.cbObjects.ListIndex) ResetProperties inf.Modules("Main").Objects(lIndex).Properties ResetAttributes inf.Modules("Main").Objects(lIndex).Attributes frmMain.txtCode = "" frmMain.txtArguments = "" If inf.Modules("Main").Objects(lIndex).ClassName <> "" Then frmMain.cbClassName.ListIndex = frmMain.cbClassName.FindItemIndex(inf.Modules("Main").Objects(lIndex).ClassName, True) frmMain.cbDelClassName.Enabled = True Else frmMain.cbClassName.ListIndex = -1 frmMain.cbDelClassName.Enabled = False End If If inf.Modules("Main").Objects(lIndex).ParentName <> "" Then frmMain.cbParentName.ListIndex = frmMain.cbParentName.FindItemIndex(inf.Modules("Main").Objects(lIndex).ParentName, True) frmMain.cbDelParentName.Enabled = True Else frmMain.cbParentName.ListIndex = -1 frmMain.cbDelParentName.Enabled = False End If frmMain.txtShortName = inf.Modules("Main").Objects(lIndex).ShortName frmMain.cbProc.ListIndex = -1 frmMain.cbDelClass.Enabled = False frmMain.cbDelObj.Enabled = True frmMain.cbDelProc.Enabled = False frmMain.cbDelProp.Enabled = False frmMain.chkPrivate.Enabled = False frmMain.cbProps.Enabled = True frmMain.mnuReplace.Visible = False txtCode.Enabled = False txtArguments.Enabled = False lblArguments.Enabled = False cbResize.Enabled = False If isOtherSack(lIndex) Then frmMain.mnuSack.Visible = False frmMain.mnusep3.Visible = False Else frmMain.mnuSack.Visible = True frmMain.mnusep3.Visible = True If inf.Modules("Main").Objects(lIndex).isSackObject Then frmMain.mnuSack.Checked = True Else frmMain.mnuSack.Checked = False End If End If If inf.Modules("Main").Objects(lIndex).Properties.Find("description") > 0 Then cbProps.ListIndex = cbProps.FindItemIndex("description", True) End If SetDirections True End Sub Private Sub cbParentName_Click() If frmMain.cbParentName.ListIndex = -1 Then Exit Sub If frmMain.cbObjects.Text = frmMain.cbParentName.Text And frmMain.cbParentName.Text <> "" Then MsgBox "Invalid circular reference.", vbExclamation, "Select Parent" frmMain.cbParentName.ListIndex = -1 Else inf.Modules("Main").Objects(cbObjects.Text).ParentName = cbParentName.Text frmMain.cbDelParentName.Enabled = True End If End Sub Private Sub cbProc_Click() Dim PIndex As Long With frmMain If .cbProc.ListIndex = -1 Then Exit Sub .cbClasses.ListIndex = -1 .cbObjects.ListIndex = -1 PIndex = .cbProc.ItemData(.cbProc.ListIndex) .txtArguments = inf.Modules("Main").Procedures(PIndex).Arguments .txtCode.Text = FormatCode(inf.Modules("Main").Procedures(PIndex).Code) .txtArguments.Enabled = True .lblArguments.Enabled = True .txtCode.Enabled = True .cbResize.Enabled = True End With frmMain.txtShortName.Text = "" frmMain.cbPropertyType.ListIndex = -1 SetControls False SetDirections False frmMain.cbDelClass.Enabled = False frmMain.cbDelObj.Enabled = False frmMain.cbDelProc.Enabled = True frmMain.cbDelProp.Enabled = False frmMain.mnuSack.Visible = True frmMain.mnusep3.Visible = True frmMain.lblPropType.Enabled = False frmMain.cbPropertyType.Enabled = False frmMain.mnuReplace.Visible = True frmMain.mnuReplace.Checked = inf.Modules("Main").Procedures(PIndex).Replace End Sub Private Sub cbPropertyType_Click() If frmMain.cbPropertyType.ListIndex <> -1 Then If frmMain.cbProps.Text <> "" Then If frmMain.cbObjects.Text <> "" Then inf.Modules("Main").Objects(frmMain.cbObjects.Text).Properties(frmMain.cbProps.Text).Mode = cbPropertyType.ListIndex Else inf.Modules("Main").Classes(frmMain.cbClasses.Text).Properties(frmMain.cbProps.Text).Mode = cbPropertyType.ListIndex End If End If End If End Sub Private Sub cbProps_Click() Dim prop As infProperty Dim lIndex As Long Dim sProp As String If frmMain.cbProps.ListIndex = -1 Then Exit Sub If frmMain.cbProps.ItemData(frmMain.cbProps.ListIndex) = -1 Then frmMain.cbProps.ListIndex = -1 Exit Sub End If frmMain.chkPrivate.Enabled = True frmMain.lblPropType.Enabled = True frmMain.cbPropertyType.Enabled = True txtCode.Enabled = True txtArguments.Enabled = True lblArguments.Enabled = True cbResize.Enabled = True If isObject Then With frmMain.cbObjects lIndex = .ItemData(.ListIndex) If lIndex = 0 Then ' ' not created yet ' Exit Sub End If sProp = frmMain.cbProps.Text If inf.Modules("Main").Objects(lIndex).Properties.Find(sProp) = 0 Then inf.Modules("Main").Objects(lIndex).Properties.Add sProp, infptPROCEDURE, "", "", False If InStr(1, "n_to ne_to e_to se_to s_to sw_to w_to nw_to d_to u_to in_to out_to", frmMain.cbProps.Text) > 0 Then inf.Modules("Main").Objects(lIndex).Properties(frmMain.cbProps.Text).Mode = infptIDENTIFIER frmMain.cbPropertyType.ListIndex = infptIDENTIFIER End If ResetProperties inf.Modules("Main").Objects(lIndex).Properties frmMain.cbProps.ListIndex = frmMain.cbProps.FindItemIndex(sProp, True) frmMain.chkPrivate.Value = 0 frmMain.txtCode.SetFocus Else Set prop = inf.Modules("Main").Objects(lIndex).Properties(frmMain.cbProps.Text) If prop.Code <> "" Then If prop.Mode = infptPROCEDURE Then frmMain.txtCode = FormatCode(prop.Code) frmMain.txtArguments = prop.Arguments Else frmMain.txtCode = prop.Code End If frmMain.cbPropertyType.ListIndex = prop.Mode End If If prop.isPrivate Then frmMain.chkPrivate = 1 Else frmMain.chkPrivate = 0 End If End With Else With frmMain.cbClasses lIndex = .ItemData(.ListIndex) If lIndex = 0 Then ' ' not created yet ' Exit Sub End If sProp = frmMain.cbProps.Text If inf.Modules("Main").Classes(lIndex).Properties.Find(sProp) = 0 Then inf.Modules("Main").Classes(lIndex).Properties.Add sProp, infptPROCEDURE, "", "", False If InStr(1, "n_to ne_to e_to se_to s_to sw_to w_to nw_to d_to u_to in_to out_to", frmMain.cbProps.Text) > 0 Then inf.Modules("Main").Classes(lIndex).Properties(frmMain.cbProps.Text).Mode = infptIDENTIFIER frmMain.cbPropertyType.ListIndex = infptIDENTIFIER End If ResetProperties inf.Modules("Main").Classes(lIndex).Properties frmMain.cbProps.ListIndex = frmMain.cbProps.FindItemIndex(sProp, True) frmMain.txtCode.SetFocus frmMain.chkPrivate = 0 Else Set prop = inf.Modules("Main").Classes(lIndex).Properties(frmMain.cbProps.Text) If prop.Code <> "" Then If prop.Mode = infptPROCEDURE Then frmMain.txtCode = FormatCode(prop.Code) frmMain.txtArguments = prop.Arguments Else frmMain.txtCode = prop.Code End If frmMain.cbPropertyType.ListIndex = prop.Mode End If If prop.isPrivate Then frmMain.chkPrivate = 1 Else frmMain.chkPrivate = 0 End If End With End If frmMain.cbDelProp.Enabled = True End Sub Private Sub Form_Load() 'Me.WindowState = vbMaximized LoadSettings SetAll False frmSplash.Show 1 End Sub Private Sub mnuAbout_Click() frmAbout.Show 1 End Sub Private Sub mnuCompile_Click() Dim lLibOption As Long Dim LibPath As String Dim CompilerPath As String Dim Switches As String Dim lsFilePath As String Dim lChecks As Long Dim isEnd As String Dim PrintLine As String Dim BatchFilename As String Dim LogFile As String Dim KillFile As String Dim SaveAsFilename As String Dim ChangeDir As String Dim DirPath As String On Error GoTo 0 On Error Resume Next lsFilePath = Left(inf.Modules("Main").Name, InStr(1, inf.Modules("Main").Name, ".") - 1) ChDir App.Path MkDir lsFilePath KillFile = App.Path & "\" & lsFilePath & "\*.*" KillFile = Replace(KillFile, "\\", "\") Kill KillFile ' get rid of the current files On Error GoTo CompileError ' ' Get the appropriate Library files and Compiler ' lLibOption = CLng(ReadReg(inf.Modules("Main").Name, "Library")) Select Case lLibOption Case 0 LibPath = ReadReg("Library", "0") CompilerPath = App.Path & "\bin\6.15" Case 1 LibPath = ReadReg(inf.Modules("Main").Name, "Path") CompilerPath = App.Path & "\bin\6.15" Case 2 LibPath = ReadReg("Library", "2") CompilerPath = App.Path & "\bin\6.21" Case 3 LibPath = ReadReg(inf.Modules("Main").Name, "Path") CompilerPath = App.Path & "\bin\6.21" Case 4 LibPath = ReadReg("Library", "4") CompilerPath = App.Path & "\bin\6.21G" Case 5 LibPath = ReadReg(inf.Modules("Main").Name, "Path") CompilerPath = App.Path & "\bin\6.21G" End Select CompilerPath = Replace(CompilerPath, "\\", "\") Dim obj As Object ' ' Save temp version of file ' SaveAsFilename = App.Path & "\" & lsFilePath & "\" & inf.Modules("Main").Name SaveAsFilename = Replace(SaveAsFilename, "\\", "\") If Not inf.SaveInformFile("Main", SaveAsFilename, infmtMAIN, obj) Then MsgBox "Can't save file in its current state.", vbOKOnly, "Compile" Exit Sub End If Switches = ReadReg(inf.Modules("Main").Name, "Switches") BatchFilename = App.Path & "\" & lsFilePath & "\Compile.Bat" BatchFilename = Replace(BatchFilename, "\\", "\") Open BatchFilename For Output As #1 PrintLine = "Copy " & Chr(34) & LibPath & "\*.*" & Chr(34) & " " & Chr(34) & App.Path & "\" & lsFilePath & Chr(34) PrintLine = Replace(PrintLine, "\\", "\") Print #1, PrintLine PrintLine = "Copy " & Chr(34) & CompilerPath & "\*.*" & Chr(34) & " " & Chr(34) & App.Path & "\" & lsFilePath & Chr(34) PrintLine = Replace(PrintLine, "\\", "\") Print #1, PrintLine Select Case lLibOption Case 0, 1 PrintLine = Chr(34) & App.Path & "\" & lsFilePath & "\infrmw32" & Chr(34) & " " & Switches & " " & Chr(34) & App.Path & "\" & lsFilePath & "\" & inf.Modules("Main").Name & Chr(34) & " >Compile.Log" Case 2, 3 PrintLine = Chr(34) & App.Path & "\" & lsFilePath & "\infrmw32" & Chr(34) & " " & Switches & " " & Chr(34) & App.Path & "\" & lsFilePath & "\" & inf.Modules("Main").Name & Chr(34) & " >Compile.Log" Case 4, 5 PrintLine = Chr(34) & App.Path & "\" & lsFilePath & "\informbp" & Chr(34) & " " & Switches & " " & Chr(34) & App.Path & "\" & lsFilePath & "\" & inf.Modules("Main").Name & Chr(34) & " >Compile.Log" End Select PrintLine = Replace(PrintLine, "\\", "\") Print #1, PrintLine PrintLine = "Copy " & Chr(34) & App.Path & "\" & lsFilePath & "\Compile.Log" & Chr(34) & " " & Chr(34) & App.Path & "\" & lsFilePath & "\compile.end" & Chr(34) PrintLine = Replace(PrintLine, "\\", "\") Print #1, PrintLine Close #1 ChangeDir = App.Path & "\" & lsFilePath ChangeDir = Replace(ChangeDir, "\\", "\") ChDir ChangeDir Shell "Compile.Bat", vbHide frmResults.Show frmResults.Top = frmMain.Top + 10 frmResults.Left = frmMain.Left + 10 frmResults!txtResults.Text = "Switches: " & Switches CheckAgain: On Error GoTo 0 On Error Resume Next DirPath = App.Path & "\" & lsFilePath & "\Compile.end" DirPath = Replace(DirPath, "\\", "\") isEnd = Dir(DirPath) If Not isEnd = "compile.end" Then lChecks = lChecks + 1 DoEvents If lChecks = 10000 Then frmResults.txtResults.Text = frmResults.txtResults.Text & vbCrLf & "No Compile." Exit Sub End If GoTo CheckAgain Else Close 10 LogFile = App.Path & "\" & lsFilePath & "\Compile.Log" LogFile = Replace(LogFile, "\\", "\") Open LogFile For Input As #10 Do Until EOF(10) Line Input #10, ln$ frmResults.txtResults.Text = frmResults.txtResults.Text & vbCrLf & ln$ Loop Close #10 End If Exit Sub CompileError: Close 1, 10 Err.Raise Err.Number, Err.Source, Err.Description End Sub Private Sub mnuEditArrays_Click() frmArrays.Show 1 End Sub Private Sub mnuEditAttribs_Click() frmAttrDefs.Show 1 End Sub Private Sub mnuEditConstants_Click() frmConstants.Show 1 End Sub Private Sub mnuEditGlobals_Click() frmGlobals.Show 1 End Sub Private Sub mnuEditGrammar_Click() frmGrammar.Show 1 End Sub Private Sub mnuEditProps_Click() frmPropDefs.Show 1 End Sub Private Sub mnuEditReplace_Click() frmReplaces.Show 1 End Sub Private Sub mnuExit_Click() End End Sub Private Sub LoadFile() Dim cls As infObject Dim obj As infObject Dim prc As infProcedure Dim prp As infNameDef Dim sRoom As String Dim sNewItem As String Dim prop As infVProperty Dim PIndex As Long Dim pName As String Dim mName As String Dim lSlash As Long Dim sYN As String Dim lCompilerOption Dim prpty As infProperty Dim sError As String Dim ParseError As infComment On Error Resume Next sCurrentFilename = sFilename If isLoaded Then ' ' *** SAVE ROUTINE *** ' sYN = MsgBox("Do you wish to save the file " & sCurrentFilename & "?", vbYesNoCancel, "Save Current File") If sYN = vbYes Then mnuFileSave_Click End If If sYN = vbCancel Then Exit Sub ' ' Destroy previous data ' ClearAll inf.Modules.Remove "Main" isLoaded = False mnuSet.Visible = False End If If sOpenFilename = "" Then Me.cdfile.ShowOpen If Err.Number <> 0 Or Me.cdfile.FileName = "" Then Exit Sub sFilename = cdfile.FileName Else sFilename = sOpenFilename End If frmMain.lblStatus.Enabled = True frmMain.pbLoad.Enabled = True frmMain.lblStatus.Visible = True frmMain.pbLoad.Visible = True frmMain.lblStatus = "Loading file..." DoEvents If Not inf.LoadInformFile(sFilename, infmtMAIN, "Main", fmHIDE, frmMain.pbLoad, sError) Then isLoaded = False MsgBox sError, vbCritical, "Load File" frmMain.lblStatus = "" frmMain.pbLoad.Visible = False Exit Sub Else If Not inf.Modules("Main").ParseSuccessful Then isLoaded = False frmMain.lblStatus = "" frmMain.pbLoad.Visible = False frmResults.Show frmResults!txtResults.Text = "Parsing Error Log" & vbCrLf & vbCrLf For Each ParseError In inf.Modules("Main").ParseErrors frmResults!txtResults.Text = frmResults!txtResults.Text & ParseError.Text & vbCrLf Next inf.Modules.Remove "Main" Exit Sub ElseIf inf.Modules("Main").ParseErrors.Count > 0 Then frmResults.Show frmResults!txtResults.Text = "Parsing Error Log" & vbCrLf & vbCrLf For Each ParseError In inf.Modules("Main").ParseErrors frmResults!txtResults.Text = frmResults!txtResults.Text & ParseError.Text & vbCrLf Next End If isLoaded = True SetAll True lSlash = RInstr(Len(sFilename), sFilename, "\") mName = Right(sFilename, Len(sFilename) - lSlash) frmMain.Caption = "Visual Inform [" & mName & "]" inf.Modules("Main").Name = mName inf.BrowserFilename = ReadReg("", "BrowserFilename") AddFileToHistory sFilename ' ' Make sure the code is formated properly ' For Each prc In inf.Modules("Main").Procedures prc.Code = FormatCode(prc.Code) Next For Each oc In inf.Modules("Main").Objects For Each prpty In oc.Properties If prpty.Mode = infptPROCEDURE Then prpty.Code = FormatCode(prpty.Code) Next Next For Each oc In inf.Modules("Main").Classes For Each prpty In oc.Properties If prpty.Mode = infptPROCEDURE Then prpty.Code = FormatCode(prpty.Code) Next Next End If ' ' Load classes and objects ' With frmMain frmMain.lblStatus.Caption = "Loading classes..." If inf.Modules("Main").Classes.Count > 0 Then frmMain.pbLoad.Value = 1 frmMain.pbLoad.Max = inf.Modules("Main").Classes.Count * 2 + 1 For Each cls In inf.Modules("Main").Classes sNewItem = cls.Name With .cbClasses .AddItemAndData sNewItem, , 4, vbBlue, , , , , , , sfClasses .ItemData(.NewIndex) = inf.Modules("Main").Classes(sNewItem).Index frmMain.pbLoad.Value = frmMain.pbLoad.Value + 1 End With ' ' Add all the classes to the object classname drop down ' With .cbClassName .AddItemAndData sNewItem, , 4, vbBlue, , , , , , , sfClasses .ItemData(.NewIndex) = inf.Modules("Main").Classes(sNewItem).Index frmMain.pbLoad.Value = frmMain.pbLoad.Value + 1 End With DoEvents Next End If frmMain.lblStatus.Caption = "Loading objects..." If inf.Modules("Main").Objects.Count > 0 Then frmMain.pbLoad.Value = 1 frmMain.pbLoad.Max = inf.Modules("Main").Objects.Count * 2 + 1 For Each obj In inf.Modules("Main").Objects sNewItem = obj.Name With .cbObjects .AddItemAndData obj.Name, , 4, vbBlue, , , , , , , sfObjects .ItemData(.NewIndex) = inf.Modules("Main").Objects(sNewItem).Index frmMain.pbLoad.Value = frmMain.pbLoad.Value + 1 End With ' ' Add all the objects to the parentname drop down ' With .cbParentName .AddItemAndData obj.Name, , 4, vbBlue, , , , , , , sfObjects .ItemData(.NewIndex) = inf.Modules("Main").Objects(sNewItem).Index frmMain.pbLoad.Value = frmMain.pbLoad.Value + 1 End With DoEvents Next End If ' ' Procedures ' If inf.Modules("Main").Procedures.Count > 0 Then frmMain.lblStatus.Caption = "Loading procedures..." frmMain.pbLoad.Value = 1 frmMain.pbLoad.Max = inf.Modules("Main").Procedures.Count + 1 With frmMain.cbProc .Clear For Each prc In inf.Modules("Main").Procedures pName = prc.Name PIndex = prc.Index .AddItemAndData pName, , 10, ddUserColor, , , , , , , sfProcedures .ItemData(.NewIndex) = PIndex frmMain.pbLoad.Value = frmMain.pbLoad.Value + 1 DoEvents Next End With End If isObject = True sRoom = GetStartingLocation If sRoom <> "" Then lIndex = frmMain.cbObjects.FindItemIndex(sRoom, True) If frmMain.cbObjects.ListCount > 0 Then frmMain.cbObjects.ListIndex = lIndex End With frmMain.lblStatus = "" frmMain.pbLoad.Visible = False mnuSet.Visible = True mnuEdit.Visible = True mnuInform.Visible = True mnuFileClose.Visible = True mnuFileSave.Visible = True mnuFileSaveAs.Visible = True CheckCompilerSettings End Sub Private Function GetStartingLocation() Dim sProc As String Dim lFind As Long Dim scFind As Long On Error GoTo errorHandler If inf.Modules("Main").Procedures.Find("Initialise") <> 0 Then sProc = inf.Modules("Main").Procedures("Initialise").Code ElseIf inf.Modules("Main").Procedures.Find("Main") <> 0 Then sProc = inf.Modules("Main").Procedures("Main").Code Else GetStartingLocation = "" Exit Function End If lFind = InStr(1, sProc, "location") lFind = InStr(lFind, sProc, "=") scFind = InStr(lFind + 1, sProc, ";") GetStartingLocation = Trim(Mid(sProc, lFind + 1, scFind - lFind - 1)) exitHandler: Exit Function errorHandler: GetStartingLocation = "" Resume exitHandler End Function Public Sub ResetProperties(uProps As infProperties) ' ' add used props ' add user unused ' library unused Dim prop As infVProperty Dim prp As infNameDef Dim uprp As infProperty Dim pCount As Long ' ' Reset all to unused ' ResetLibraryProperties frmMain.cbProps.Clear ' ' Add user properties ' For Each prp In inf.Modules("Main").PropertyDefs Properties.Add prp.Name, False, False Next ' ' Set used properties ' For Each uprp In uProps If Properties.Find(uprp.Name) = 0 Then ' ' If it doesn't exist - add it - probably defined in an include ' Properties.Add uprp.Name, True, True Else Properties(uprp.Name).Used = True End If Next pCount = 0 ' ' Add user used ' For Each prop In Properties If Not prop.Library And prop.Used Then pCount = pCount + 1 frmMain.cbProps.AddItemAndData prop.Name, , 10, ddUserColor, , , , , , , sfUserUsed End If Next ' ' Add library used ' For Each prop In Properties If prop.Library And prop.Used Then pCount = pCount + 1 frmMain.cbProps.AddItemAndData prop.Name, , 10, ddLibraryColor, , , , , , , sfLibraryUsed End If Next If pCount > 0 Then frmMain.cbProps.AddItemAndData String(100, "-"), , , vbBlack, vbBlack, , , 3, , , sfSymbol frmMain.cbProps.ItemData(frmMain.cbProps.NewIndex) = -1 End If ' ' Add user unused ' For Each prop In Properties If Not prop.Library And Not prop.Used Then frmMain.cbProps.AddItemAndData prop.Name, , 4, ddUserColor, , , , , , , sfUserUnused End If Next ' ' Add library unused ' For Each prop In Properties If prop.Library And Not prop.Used Then frmMain.cbProps.AddItemAndData prop.Name, , 4, ddLibraryColor, , , , , , , sfLibraryUnused End If Next End Sub Public Sub ResetAttributes(uAttribs As infAttributes) ' ' add used attribs ' add user unused ' library unused Dim attr As infVAttribute Dim atr As infNameDef Dim uatr As infAttribute ' ' Reset all to unused ' ResetLibraryAttributes frmMain.cbAttribs.Clear For Each atr In inf.Modules("Main").AttributeDefs Attributes.Add atr.Name, False, False Next ' ' Set used Attributes ' For Each uatr In uAttribs If Attributes.Find(uatr.Name) = 0 Then ' ' If it doesn't exist - add it - probably defined in an include ' Attributes.Add uatr.Name, True, True Else Attributes(uatr.Name).Used = True End If Next ' ' Add all ' For Each attr In Attributes If attr.Library Then frmMain.cbAttribs.AddItemAndData attr.Name, , 10, ddLibraryColor, , , , , , , sfLibraryUnused Else frmMain.cbAttribs.AddItemAndData attr.Name, , 10, ddUserColor, , , , , , , sfUserUnused End If If attr.Used Then frmMain.cbAttribs.Selected(frmMain.cbAttribs.NewIndex) = True Next frmMain.cbAttribs.Selected(0) = Not frmMain.cbAttribs.Selected(0) frmMain.cbAttribs.Selected(0) = Not frmMain.cbAttribs.Selected(0) End Sub Private Sub SetDirections(bObject As Boolean) Dim lDir As Long If Not bObject Then With frmMain For lDir = 0 To 12 .cbDir(lDir).Enabled = False Next lDir .fmDir.Enabled = False End With Else With frmMain .fmDir.Enabled = True For lDir = 0 To 12 .cbDir(lDir).Enabled = True Next lDir End With DetermineDirections End If End Sub Private Sub cbResize_Click() Dim lSelStart As Long Dim lSelLength As Long lSelStart = frmMain.txtCode.SelStart lSelLength = frmMain.txtCode.SelLength If frmMain.txtCode.Top = 15.25 Then frmMain.txtCode.Top = 0.25 frmMain.txtCode.Height = 28.625 frmMain.cbResize.Caption = "(click to restore screen)" Else frmMain.txtCode.Top = 15.25 frmMain.txtCode.Height = 13.75 frmMain.cbResize.Caption = "(click for full screen)" End If frmMain.txtCode.SelStart = lSelStart frmMain.txtCode.SelLength = 0 frmMain.txtCode.ZOrder 0 End Sub Private Sub mnuFileClose_Click() If isLoaded Then ' ' *** Save Routine *** ' ClearAll If inf.Modules.Count > 0 Then inf.Modules.Remove "Main" Me.Caption = "Visual Inform" Me.statusbar.SimpleText = "" End If End If mnuSet.Visible = False mnuEdit.Visible = False mnuInform.Visible = False mnuFileClose.Visible = False mnuFileSave.Visible = False mnuFileSaveAs.Visible = False SetAll False isLoaded = False End Sub Private Sub mnuFileNew_Click() If isLoaded Then ' ' *** Save Routine *** ' ClearAll inf.Modules.Remove "Main" End If inf.Modules.Add "Main", infmtMAIN mnuFileSaveAs_Click If bSaveAs Then isLoaded = True SetAll True cbDelClass.Enabled = False cbDelObj.Enabled = False cbDelProc.Enabled = False cbDelProp.Enabled = False cbProps.Enabled = False cbDelParentName.Enabled = False cbDelClassName.Enabled = False cbClassName.Enabled = False lblClassName.Enabled = False mnuSet.Visible = True mnuInform.Visible = True mnuEdit.Visible = True mnuFileClose.Visible = True mnuFileSave.Visible = True mnuFileSaveAs.Visible = True CheckCompilerSettings Else inf.Modules.Remove "Main" End If ' ' Add 'initialise' procedure to list and set as current thing to edit ' frmMain.cbProc.AddItemAndData "Initialise", , 4, vbBlue, , , , , , , sfProcedures frmMain.cbProc.ItemData(frmMain.cbProc.NewIndex) = inf.Modules("Main").Procedures.Count frmMain.cbProc.ListIndex = frmMain.cbProc.NewIndex End Sub Private Sub mnuFileOpen_Click() sOpenFilename = "" LoadFile End Sub Private Sub mnuFileSave_Click() Dim bSave As Boolean Dim prc As infProcedure Dim oc As infObject Dim prop As infProperty If Dir(sFilename) <> "" Then FileCopy sFilename, sFilename & ".bak" Kill sFilename End If bSave = inf.SaveInformFile("Main", sFilename, infmtMAIN, frmMain.pbLoad) If bSave Then statusbar.SimpleText = "File has been saved." frmMain.Caption = "Visual Inform [" & inf.Modules("Main").Name & "]" End Sub Private Sub mnuFileSaveAs_Click() Dim yn As String Dim lsFilename As String On Error Resume Next DoAgain: Me.cdfile.ShowSave If Err.Number <> 0 Or Me.cdfile.FileName = "" Then bSaveAs = False Exit Sub End If If Len(cdfile.FileName) < 5 Then MsgBox "The filename must be at least 1 character and the '.inf' extension.", vbOKOnly, "SaveAs" GoTo DoAgain End If If Not Left(Right(cdfile.FileName, 5), 1) Like "[A-Za-z0-9_]" Then MsgBox "Valid characters for the filename include letters, numbers, and underscore.", vbOKOnly, "SaveAs" GoTo DoAgain End If If Right(cdfile.FileName, 4) <> ".inf" Then MsgBox "The filename must end with the '.inf' extension.", vbOKOnly, "SaveAs" GoTo DoAgain End If lsFilename = Right(cdfile.FileName, Len(cdfile.FileName) - RInstr(Len(cdfile.FileName), cdfile.FileName, "\")) If Dir(Me.cdfile.FileName) <> "" Then yn = MsgBox("The file '" & Me.cdfile.FileName & "' already exists. Do you wish to overwrite it?", vbYesNoCancel, "Save As") If yn <> vbYes Then bSaveAs = False Exit Sub End If End If bSaveAs = True sFilename = Me.cdfile.FileName inf.Modules("Main").Name = lsFilename mnuFileSave_Click End Sub Private Sub mnuGSettings_Click() frmGSettings.Show 1 End Sub Private Sub mnuHelpDMan_Click() If Not isLoaded Then MsgBox "Either create a new file or open a file before using the help feature.", vbInformation, "Open Browser with Designer's Manual" Exit Sub End If If Dir(inf.BrowserFilename) = "" Then MsgBox "Either you need to select a browser program (Game Settings) or the one you've selected was not found.", vbExclamation, "Open Browser with Designer's Manual" Exit Sub End If On Error GoTo helpError Dim helpID As Long helpID = Shell(Chr(34) & inf.BrowserFilename & Chr(34) & " " & Chr(34) & App.Path & "\Help\DMan\index.html" & Chr(34), vbNormalFocus) helpExit: Exit Sub helpError: MsgBox "User's browser is not found or an error ocurred executing the file.", vbCritical, "Designer's Manual" Resume helpExit End Sub Private Sub mnuOpenFile1_Click() sOpenFilename = ReadReg("Recent Files", "1") LoadFile End Sub Private Sub mnuOpenFile2_Click() sOpenFilename = ReadReg("Recent Files", "2") LoadFile End Sub Private Sub mnuOpenFile3_Click() sOpenFilename = ReadReg("Recent Files", "3") LoadFile End Sub Private Sub mnuOpenFile4_Click() sOpenFilename = ReadReg("Recent Files", "4") LoadFile End Sub Private Sub SetControls(cType As Boolean) Dim OIndex As Long With frmMain .cbClassName.ListIndex = -1 .cbParentName.ListIndex = -1 .cbProps.ListIndex = -1 .cbClassName.Enabled = cType .cbParentName.Enabled = cType .cbProps.Enabled = cType .cbAttribs.Enabled = cType .lblAttribs.Enabled = cType .lblClassName.Enabled = cType .lblParentName.Enabled = cType .lblProps.Enabled = cType .txtShortName.Enabled = cType .lblSN1.Enabled = cType .lblSN2.Enabled = cType End With End Sub Private Sub SetAll(bSet As Boolean) Dim oItem As Variant On Error Resume Next For Each oItem In frmMain.Controls If Left(oItem.Name, 3) <> "mnu" And oItem.Name <> "pbLoad" And oItemname <> "lblStatus" Then oItem.Enabled = bSet End If Next On Error GoTo 0 End Sub Private Sub ClearAll() With frmMain .cbObjects.Clear .cbClasses.Clear .cbParentName.Clear .cbProc.Clear .cbClassName.Clear .cbAttribs.Clear .cbProps.Clear .txtArguments = "" .txtCode = "" .txtShortName = "" .cbPropertyType.ListIndex = -1 End With End Sub Private Function isOtherSack(OIndex As Long) As Boolean ' ' Determine if some other object has already been set as a sack object ' Dim obj As infObject For Each obj In inf.Modules("Main").Objects If obj.Index <> OIndex And obj.isSackObject Then isOtherSack = True Exit Function End If Next isOtherSack = False End Function Private Sub mnuPlay_Click() Dim lLibOption As Long Dim lsFilePath As String lsFilePath = Left(inf.Modules("Main").Name, InStr(1, inf.Modules("Main").Name, ".") - 1) ' ' Get the appropriate Library files and Compiler ' lLibOption = CLng(ReadReg(inf.Modules("Main").Name, "Library")) Select Case lLibOption Case 0, 1, 2, 3 Shell Chr(34) & App.Path & "\bin\winfrotz\winfrotz.exe" & Chr(34) & " " & Chr(34) & App.Path & "\" & lsFilePath & "\" & Left(inf.Modules("Main").Name, InStr(1, inf.Modules("Main").Name, ".") - 1) & ".z5" & Chr(34), vbNormalFocus Case 4, 5 Shell Chr(34) & App.Path & "\bin\glulxe\glulxe.exe" & Chr(34) & " " & Chr(34) & App.Path & "\" & lsFilePath & "\" & Left(inf.Modules("Main").Name, InStr(1, inf.Modules("Main").Name, ".") - 1) & ".glx" & Chr(34), vbNormalFocus End Select End Sub Private Sub mnuReplace_Click() mnuReplace.Checked = Not mnuReplace.Checked inf.Modules("Main").Procedures(cbProc.Text).Replace = mnuReplace.Checked End Sub Private Sub mnuSack_Click() mnuSack.Checked = Not mnuSack.Checked inf.Modules("Main").Objects(cbObjects.Text).isSackObject = mnuSack.Checked End Sub Private Sub mnuSettings_Click() frmSettings.Show 1 End Sub Private Sub DetermineDirections() Dim obj As infObject Dim d As Long Set obj = inf.Modules("Main").Objects(cbObjects.Text) For d = 0 To 12 MainDirs(d) = "" Next d SetDirs MainDirs(), obj For d = 0 To 12 If MainDirs(d) = "" Then frmMain.cbDir(d).Enabled = False Else frmMain.cbDir(d).Enabled = True End If Next d End Sub Private Sub SetDirs(mDirs() As String, oItem As infObject) ' ' Recursive, never overwrite a set direction ' Dim prop As infProperty Dim lDir As Long For Each prop In oItem.Properties If prop.Mode = infptIDENTIFIER Then Select Case prop.Name Case "n_to" lDir = N_TO Case "ne_to" lDir = NE_TO Case "e_to" lDir = E_TO Case "se_to" lDir = SE_TO Case "s_to" lDir = S_TO Case "sw_to" lDir = SW_TO Case "w_to" lDir = W_TO Case "nw_to" lDir = NW_TO Case "in_to" lDir = IN_TO Case "out_to" lDir = OUT_TO Case "u_to" lDir = U_TO Case "d_to" lDir = D_TO Case "cant_go" lDir = CANT_GO End Select If mDirs(lDir) = "" Then mDirs(lDir) = prop.Code End If Next If oItem.ClassName <> "" Then SetDirs mDirs(), inf.Modules("Main").Classes(oItem.ClassName) End If End Sub Private Sub txtCode_Change() If frmMain.cbClasses.ListIndex > -1 Then If frmMain.cbProps.ListIndex > -1 Then inf.Modules("Main").Classes(frmMain.cbClasses.Text).Properties(frmMain.cbProps.Text).Code = frmMain.txtCode.Text End If ElseIf frmMain.cbObjects.ListIndex > -1 Then If frmMain.cbProps.ListIndex > -1 Then inf.Modules("Main").Objects(frmMain.cbObjects.Text).Properties(frmMain.cbProps.Text).Code = frmMain.txtCode.Text End If ElseIf frmMain.cbProc.ListIndex > -1 Then inf.Modules("Main").Procedures(frmMain.cbProc.Text).Code = frmMain.txtCode.Text End If End Sub Private Sub txtCode_GotFocus() Dim oItem As Variant On Error Resume Next For Each oItem In frmMain.Controls If Left(oItem.Name, 3) <> "mnu" And oItem.Name <> "pbLoad" And oItemname <> "lblStatus" Then oItem.TabStop = False End If Next On Error GoTo 0 End Sub Private Sub txtCode_LostFocus() Dim oItem As Variant On Error Resume Next For Each oItem In frmMain.Controls If Left(oItem.Name, 3) <> "mnu" And oItem.Name <> "pbLoad" And oItemname <> "lblStatus" Then oItem.TabStop = True End If Next On Error GoTo 0 End Sub Private Sub CheckCompilerSettings() ' ' Check for compiler options ' Dim objRegKey As RegKey On Error Resume Next Set objRegKey = RegKeyFromString("\HKEY_LOCAL_MACHINE\Software\VInform\" & inf.Modules("Main").Name) If Err.Number <> 0 Then Set objRegKey = RegKeyFromString("\HKEY_LOCAL_MACHINE\Software\VInform") objRegKey.SubKeys.Add inf.Modules("Main").Name Set objRegKey = RegKeyFromString("\HKEY_LOCAL_MACHINE\Software\VInform\" & inf.Modules("Main").Name) objRegKey.Values.Add "Library", "0" objRegKey.Values.Add "Path", "" objRegKey.Values.Add "Switches", "" End If End Sub