'Created By: NAME
'Date: March 07, 2014
'Title: MAINT_BlendedItemsClear
'Reading File from C:\Users\NAME\Documents\AHK\Batch_Manipulator\Batch_Manipulator_File.txt
Sub ReadBatchManipulatorFileBlendedItemsClear()
Dim hostSettleTimeout As Integer
Dim hostSettleTime As Integer
Dim osCurrentScreen As Screen
Dim osCurrentTerminal As Terminal
Dim returnValue As Integer
Dim hiddenTextEntry As String
hostSettleTimeout = 5000
hostSettleTime = 300
Set osCurrentTerminal = ThisFrame.SelectedView.control
Set osCurrentScreen = osCurrentTerminal.Screen
' ******** This is for MAINT Blended Items Clear. Starts at Batch Payment Entry to input contract #.*************************
' Reading File from C:\Users\NAME\Documents\AHK\MyInformation\MyInformationFile.txt
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim fs, f, ts, line1
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile("C:\Users\NAME\Documents\AHK\MyInformation\MyInformationFile.txt")
Set ts = f.OpenAsTextStream(ForReading, TristateUseDefault)
line1 = ts.ReadLine ' First Line on File
line2 = ts.ReadLine ' Second Line on File
line3 = ts.ReadLine ' Third Line on File
line4 = ts.ReadLine ' Fourth Line on File
line5 = ts.ReadLine ' Fifth Line on File
line6 = ts.ReadLine ' Sixth Line on File
line7 = ts.ReadLine ' Seventh Line on File
line8 = ts.ReadLine ' Eight Line on File
line9 = ts.ReadLine ' Nineth Line on File
line10 = ts.ReadLine ' Tenth Line on File
line11 = ts.ReadLine ' Eleventh Line on File
line12 = ts.ReadLine ' Twelveth Line on File
line13 = ts.ReadLine ' Thirteenth Line on File
line14 = ts.ReadLine ' Fourteenth Line on File
line15 = ts.ReadLine ' Fifteenth Line on File
line16 = ts.ReadLine ' Sixteenth Line on File
line17 = ts.ReadLine ' Seventeenth Line on File
line18 = ts.ReadLine ' Eighteenth Line on File
line19 = ts.ReadLine ' Nineteenth Line on File
line20 = ts.ReadLine ' Twentyth Line on File
line21 = ts.ReadLine ' Twenty-First Line on File
ts.Close
osCurrentScreen.SendKeys "22"
'Wait for host to 'be quiet' before continuing
returnValue = osCurrentScreen.WaitForHostSettle(50)
osCurrentScreen.SendControlKey ControlKeyCode_Enter
'Wait for host to 'be quiet' before continuing
returnValue = osCurrentScreen.WaitForHostSettle(50)
osCurrentScreen.SendKeys "B"
'Wait for host to 'be quiet' before continuing
returnValue = osCurrentScreen.WaitForHostSettle(50)
osCurrentScreen.SendControlKey ControlKeyCode_Enter
'Wait for host to 'be quiet' before continuing
returnValue = osCurrentScreen.WaitForHostSettle(50)
osCurrentScreen.SendKeys "D"
'Wait for host to 'be quiet' before continuing
returnValue = osCurrentScreen.WaitForHostSettle(50)
osCurrentScreen.SendControlKey ControlKeyCode_Enter
'Wait for host to 'be quiet' before continuing
returnValue = osCurrentScreen.WaitForHostSettle(50)
osCurrentScreen.SendControlKey ControlKeyCode_Enter
'Wait for host to 'be quiet' before continuing
returnValue = osCurrentScreen.WaitForHostSettle(50)
osCurrentScreen.SendKeys "CASH"
'Wait for host to 'be quiet' before continuing
returnValue = osCurrentScreen.WaitForHostSettle(50)
osCurrentScreen.SendControlKey ControlKeyCode_Enter
'Wait for host to 'be quiet' before continuing
returnValue = osCurrentScreen.WaitForHostSettle(50)
Call osCurrentScreen.SendKeys(line2) ' FIRST NAME
'Wait for host to 'be quiet' before continuing
returnValue = osCurrentScreen.WaitForHostSettle(50)
osCurrentScreen.SendKeys " "
'Wait for host to 'be quiet' before continuing
returnValue = osCurrentScreen.WaitForHostSettle(50)
Call osCurrentScreen.SendKeys(line3) ' FIRST NAME
'Wait for host to 'be quiet' before continuing
returnValue = osCurrentScreen.WaitForHostSettle(50)
osCurrentScreen.SendControlKey ControlKeyCode_Enter
'Wait for host to 'be quiet' before continuing
returnValue = osCurrentScreen.WaitForHostSettle(50)
osCurrentScreen.SendControlKey ControlKeyCode_Enter
'Wait for host to 'be quiet' before continuing
returnValue = osCurrentScreen.WaitForHostSettle(50)
osCurrentScreen.SendKeys "1"
'Wait for host to 'be quiet' before continuing
returnValue = osCurrentScreen.WaitForHostSettle(50)
osCurrentScreen.SendControlKey ControlKeyCode_Enter
'Wait for host to 'be quiet' before continuing
returnValue = osCurrentScreen.WaitForHostSettle(50)
osCurrentScreen.SendControlKey ControlKeyCode_Enter
'Wait for host to 'be quiet' before continuing
returnValue = osCurrentScreen.WaitForHostSettle(50)
osCurrentScreen.SendControlKey ControlKeyCode_Enter
'Wait for host to 'be quiet' before continuing
returnValue = osCurrentScreen.WaitForHostSettle(50)
Close #1 ' Close file.
'MyFile = "C:\Users\NAME\Documents\AHK\Batch_Manipulator\Batch_Manipulator_File.txt"
'Open MyFile For Input As #1 ' Open file for input.
'Input #1, MyString1, MyString2, MyString3, MyString4 ' Read data into two variables.
'Call osCurrentScreen.SendKeys(MyString4) ' Amount
'Wait for host to 'be quiet' before continuing
'returnValue = osCurrentScreen.WaitForHostSettle(50)
'osCurrentScreen.SendControlKey ControlKeyCode_Enter
'Wait for host to 'be quiet' before continuing
'returnValue = osCurrentScreen.WaitForHostSettle(50)
'osCurrentScreen.SendControlKey ControlKeyCode_Enter
'Wait for host to 'be quiet' before continuing
'returnValue = osCurrentScreen.WaitForHostSettle(50)
'osCurrentScreen.SendControlKey ControlKeyCode_Enter
'Wait for host to 'be quiet' before continuing
'returnValue = osCurrentScreen.WaitForHostSettle(50)
'osCurrentScreen.SendControlKey ControlKeyCode_Enter
'Wait for host to 'be quiet' before continuing
'returnValue = osCurrentScreen.WaitForHostSettle(50)
'Close #1 ' Close file.
'***********Deletes 1st Line of Text File*************************
Dim iFile As Integer
Dim sData As String
iFile = FreeFile
Open "C:\Users\NAME\Documents\AHK\Batch_Manipulator\Batch_Manipulator_File.txt" For Binary Access Read As iFile
sData = Space(LOF(iFile))
Get #iFile, , sData
Close iFile
sData = Mid(sData, InStr(sData, vbCrLf) + 2)
Kill "C:\Users\NAME\Documents\AHK\Batch_Manipulator\Batch_Manipulator_File.txt"
iFile = FreeFile
Open "C:\Users\NAME\Documents\AHK\Batch_Manipulator\Batch_Manipulator_File.txt" For Binary Access Write As iFile
Put #iFile, , sData
Close iFile
End Sub