help to handle error (more unexpected window)

Get help with using AutoHotkey and its commands and hotkeys
cimerio7
Posts: 12
Joined: 30 May 2019, 12:06

help to handle error (more unexpected window)

19 Jul 2019, 08:10

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 839 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 839 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
hd0202
Posts: 163
Joined: 04 Oct 2013, 03:07
Location: Germany near Cologne

Re: help to handle error (more unexpected window)

19 Jul 2019, 10:56

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
cimerio7
Posts: 12
Joined: 30 May 2019, 12:06

Re: help to handle error (more unexpected window)

26 Jul 2019, 13:10

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.
hd0202
Posts: 163
Joined: 04 Oct 2013, 03:07
Location: Germany near Cologne

Re: help to handle error (more unexpected window)

26 Jul 2019, 16:47

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
cimerio7
Posts: 12
Joined: 30 May 2019, 12:06

Re: help to handle error (more unexpected window)

31 Jul 2019, 13:35

yes, its correct. the app requires download of java applets. :(

Return to “Ask For Help”

Who is online

Users browsing this forum: Albireo, Bing [Bot], hasantr, MarceloSitel, TAC109 and 43 guests