BattleOfMoonShae Posted January 5, 2005 Posted January 5, 2005 I am wondering, if anyone would have a solution to a issue that is eluding me? Out 27 pages of script, the section listed below is the only part that I can not get to work for me. On this section of a script that I am developing I am pulling a busn # and a customer # from one server and placing the data to another server. With the MVS server the busn # and the customer# are on separate file lines. Busn id # 12345 Cust id # 12345678 With the TCH server the Busn id & Cust ID are on the same file line with only 13 char. allowed Cust id # 1234512345678 With all the variations that I have tried, when the data is copied from MVS into the file2.txt then from the file2.txt into the TCH server (and notepad as a test platform) it pastes incorrectly. It pastes like this, 12345 12345678 instead of 1234512345678. Looking at in notepad the spacing is equal to a tab and for the life of me I can not see why it would place the spacing of a tab between the two sends in the server and notepad. If anyone has a solution it would be greatly appreciated. I am sure the answer is a simple one but as I said before it eludes me. ____________________________________________________________________ WinWait('MVS - RUMBA Mainframe Display') If Not WinActive('MVS - RUMBA Mainframe Display', '') Then WinActivate('MVS - RUMBA Mainframe Display') EndIf WinWaitActive('MVS - RUMBA Mainframe Display') Send('!e') Sleep(100) Send('l') Sleep(100) Send('!e') Sleep(100) Send('c') If FileExists('file2.txt') Then Run('cmd.exe /c del file2.txt') EndIf Sleep(500) FileWriteLine('file2.txt', ClipGet()) $line = FileReadLine('file2.txt', 4) $Busn_ID = StringMid($line, 16, 5) Sleep(50) $tempvar = $Busn_ID $Busn_ID = $tempvar $line = FileReadLine('file2.txt', 5) $Cust_ID = StringMid($line, 16, 9) Sleep(50) $tempvar = $Cust_ID $Cust_ID = $tempvar $line = FileReadLine('file2.txt', 19) $Comment1 = StringMid($line, 26, 60) Sleep(50) $tempvar = $Comment1 $Comment1 = $tempvar $line = FileReadLine('file2.txt', 20) $Comment2 = StringMid($line, 26, 60) Sleep(50) $tempvar = $Comment2 $Comment2 = $tempvar ;WinWait("TCH Credit Manager (TCH:credit)","") ;If Not WinActive("TCH Credit Manager (TCH:credit)","") Then ;WinActivate("TCH Credit Manager (TCH:credit)","") ;WinWaitActive("TCH Credit Manager (TCH:credit)","") ;notepad paste test WinWait("Untitled - Notepad","") If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","") WinWaitActive("Untitled - Notepad","") Send("{TAB 4}") Send($Busn_ID & $Cust_ID) ; Send($Cust_ID) msgbox ;error stop here
CyberSlug Posted January 5, 2005 Posted January 5, 2005 Perhaps you are reading one character too many in $Busn_ID = StringMid($line, 16, 5)or in $Cust_ID = StringMid($line, 16, 9)Maybe adjust the StringMid parameters?You might also want to try the following workaround:Send( StringStripWS($Busn_ID & $Cust_ID, 8) );remove all whitespace before sending Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
BattleOfMoonShae Posted January 5, 2005 Author Posted January 5, 2005 Thanks Cyberslug I will try the work around when I get back on the job tomorrow. I did notice that when I typed the post I did make a error $Cust_ID = StringMid($line, 16, 9) - the script at work is $Cust_ID = StringMid($line, 16, 8) I have tried moving or shorting the char. count. Same problem with the space between the Busn and the Cust # everytime.
normeus Posted January 5, 2005 Posted January 5, 2005 I noticed that you have Send("{TAB 4}") this does not behave on my computer so it might not on yours try send({tab}) Sleep(50) send({tab}) Sleep(50) send({tab}) Sleep(50) send({tab}) Sleep(50) instead. http://www.autoitscript.com/autoit3/scite/...iTe4AutoIt3.exe
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now