'Created By:
'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\" & myUser & "\Documents\AHK\MyInformation\MyInformationFile.txt
Dim myUser As String
myUser = Environ("username")
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\" & myUser & "\Documents\AHK\MyInformation\MyInformationFile.txt")
Set ts = f.OpenAsTextStream(ForReading, TristateUseDefault)
line1 = ts.ReadLine ' Email Line on File
line2 = ts.ReadLine ' First Name Line on File
line3 = ts.ReadLine ' Second Name Line on File
line4 = ts.ReadLine ' Password IL Line on File
line5 = ts.ReadLine ' Email 2 Line on File
line6 = ts.ReadLine ' Phone Line on File
line7 = ts.ReadLine ' Fax Line on File
line8 = ts.ReadLine ' Login ID Line on File
line9 = ts.ReadLine ' Pass RIT Line on File
line10 = ts.ReadLine ' Path 1 Line on File
line11 = ts.ReadLine ' Path 2 Line on File
line12 = ts.ReadLine ' Path 3 Line on File
line13 = ts.ReadLine ' Path 4 Line on File
line14 = ts.ReadLine ' Path 5 Line on File
line15 = ts.ReadLine ' Path 6 Line on File
line16 = ts.ReadLine ' Path 7 Line on File
line17 = ts.ReadLine ' Path 8 Line on File
line18 = ts.ReadLine ' Path 9 Line on File
line19 = ts.ReadLine ' Path 10 Line on File
line20 = ts.ReadLine ' Path 11 Line on File
line21 = ts.ReadLine ' Path 12 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.
'***********Deletes 1st Line of Text File*************************
Dim iFile As Integer
Dim sData As String
iFile = FreeFile
Open "C:\Users\" & myUser & "\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\" & myUser & "\Documents\AHK\Batch_Manipulator\Batch_Manipulator_File.txt"
iFile = FreeFile
Open "C:\Users\" & myUser & "\Documents\AHK\Batch_Manipulator\Batch_Manipulator_File.txt" For Binary Access Write As iFile
Put #iFile, , sData
Close iFile
End Sub