VERSION 5.00 Begin VB.Form Form4 Caption = "Batch File" ClientHeight = 5235 ClientLeft = 60 ClientTop = 630 ClientWidth = 4095 LinkTopic = "Form4" ScaleHeight = 5235 ScaleWidth = 4095 StartUpPosition = 2 'CenterScreen Begin VB.CommandButton cmdSave Caption = "Save" Height = 375 Left = 240 TabIndex = 1 Top = 3420 Width = 975 End Begin VB.FileListBox File1 Height = 285 Left = 120 Pattern = "CommandSequence.txt" TabIndex = 4 Top = 4800 Visible = 0 'False Width = 1815 End Begin VB.CommandButton cmdRunSequence Caption = "Run" Height = 375 Left = 240 TabIndex = 2 Top = 4080 Width = 975 End Begin VB.CommandButton cmdCancel Caption = "Cancel" Height = 375 Left = 240 TabIndex = 0 Top = 2760 Width = 975 End Begin VB.TextBox txtCommandSequence BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 4335 Left = 1440 MultiLine = -1 'True ScrollBars = 2 'Vertical TabIndex = 3 Top = 720 Width = 2295 End Begin VB.Label Label2 Alignment = 2 'Center Caption = "Command Sequence Edit Box" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 1440 TabIndex = 5 Top = 120 Width = 2295 End Begin VB.Menu mnuEdit Caption = "&Edit" Begin VB.Menu mnuEditCopy Caption = "&Copy" End Begin VB.Menu mnuEditCut Caption = "C&ut" End Begin VB.Menu mnuEditPaste Caption = "&Paste" End End End Attribute VB_Name = "Form4" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub cmdCancel_Click() Unload Form4 Form1.Show End Sub Private Sub cmdRunSequence_Click() gOut(0) = txtCommandSequence Call Save Unload Form4 Form1.Show End Sub Private Sub cmdSave_Click() Call Save End Sub Private Sub Form_Load() Dim buffer1 As String Dim buffer2 As String Dim FileNum As Variant Form1.txtReceive = "" buffer1 = "" buffer2 = "" FileNum = FreeFile 'The FileListBox control (named File1) on the form only lists files with the name '"CommandSequence.txt" since this is the only file in the FileListBox Pattern 'property. If this file does not exist then File1.ListCount will be 0 If File1.ListCount < 1 Then MsgBox ("No previous Command Sequence file has been saved") Exit Sub End If Open "CommandSequence.txt" For Input As FileNum Do While Not EOF(FileNum) Line Input #FileNum, buffer1 buffer2 = buffer2 & buffer1 & vbCrLf Loop Close FileNum txtCommandSequence = buffer2 End Sub Private Sub Save() Dim buffer As String Dim FileNum As Variant buffer = txtCommandSequence FileNum = FreeFile Open "CommandSequence.txt" For Output As FileNum Print #FileNum, buffer Close FileNum End Sub Private Sub mnuEditCopy_Click() If txtCommandSequence.SelLength = 0 Then Exit Sub Clipboard.SetText txtCommandSequence.SelText End Sub Private Sub mnuEditCut_Click() If txtCommandSequence.SelLength = 0 Then Exit Sub Clipboard.SetText txtCommandSequence.SelText txtCommandSequence.SelText = "" End Sub Private Sub mnuEditPaste_Click() txtCommandSequence.SelText = Clipboard.GetText() End Sub