Page 1 of 1

help to handle error (more unexpected window)

Posted: 19 Jul 2019, 08:10
by cimerio7
Hi everybody.
I made a script to automate register of new users in my system, a hod java emulator:
screen1.png
screen1.png (114.64 KiB) Viewed 1031 times
and here is the code:

Code: Select all

#SingleInstance force
SetKeyDelay, 4

#IfWinActive Terminal 3270 - A - AWVL6661

!q::


	X1 := ComObjActive("Excel.Application")

	Loop, 3 {
		Cpf%A_Index% := X1.Range("A" A_Index).Text               
		Banco%A_Index% := X1.Range("B" A_Index).Text
		Agencia%A_Index% := X1.Range("C" A_Index).Text
		Conta%A_Index% := X1.Range("D" A_Index).Text
	
	}
	
	n:= 1
	Loop, 3 {
		
	Send, % Cpf%n%            
	Sleep, 500 
	Send, {enter}
	Sleep, 500
	Send, {tab}
	Send, bsb{tab}{tab}
	Send, 9701
	Send, 70000000df{enter}
	Sleep, 250
	Send, npto{enter}
	Send, s{enter}
	Sleep, 250
	Send, % Banco%n%             
	Sleep, 500 
	Send, % Agencia%n%
	Sleep, 500 
	Send, % Conta%n%
	Sleep, 500 
	Send, {tab}1
	Send, {enter}
	Sleep, 500
	Send, pto{enter}
	Sleep, 250
	Send, s{enter}
	n := n + 1
	}
return

the problem is: if the creditor already exists in database (its possible, because the company have many branches registering users) the screen changes for new data. therefore, the script mess and dont work, because wrong data is inserted in wrong places, some protected. That is the screen showed when the creditor exist:
screen2.png
screen2.png (122.04 KiB) Viewed 1031 times
so, I need an idea for handle that. for recognize when the screen changes (is different) for the script return to other point or next creditor in excel

Re: help to handle error (more unexpected window)

Posted: 19 Jul 2019, 10:56
by hd0202
which 3270 terminal emulator do you use (e.g. Reflection from MicroFocus) ?

can you use COM Objects with your emulator ?

then you can get and put values into the screen by position (line and column) without "send" and "wait", wait for a next screen to be ready and decide your further processing depending on the content of this next screen

Hubert

Re: help to handle error (more unexpected window)

Posted: 26 Jul 2019, 13:10
by cimerio7
well, Hupert, I think that .COM is possible, but it would require more programming knowledge

I don't use the Reflection. our emulator is a internal developed soluction (I suppose): Host On-Demand product, known as HOD, whose processing is centralized on a large IBM z / OS (mainframe) server.

Re: help to handle error (more unexpected window)

Posted: 26 Jul 2019, 16:47
by hd0202
COM is possible, but it would require more programming knowledge
I know, I use COM since more than 10 years on IBM mainframes, first with PC3270, then Attachemate and now Reflection, and I had very little problems in converting my application from one software to the others, thanks to COM.

On a page of Boston University (https://www.bu.edu/tech/services/cccs/desktop/software/mainframe/host-on-demand-hod/hod/) I found the following description:
Host On-Demand (HOD) is an IBM product that provides secure (encrypted) mainframe 3270 terminal emulation service over the Internet. It does this by downloading small Java-based “applets” (small programs) to your computer. These small programs combine to provide the 3270 terminal service.
and therefore I think that COM is not possible with this Java application.

I am sorry but I cannot be of further help.

Hubert

Re: help to handle error (more unexpected window)

Posted: 31 Jul 2019, 13:35
by cimerio7
yes, its correct. the app requires download of java applets. :(