Forum Discussion

adamXpeter's avatar
adamXpeter
Occasional Visitor
2 years ago

OCR.Recognize(Aliases.x.y.z).BlockByText("FindThis") unsets Aliases when "FindThis" is not found

Hello!

Version:  15.50.3.7 x64

What I have tried: I tried to find a row in a TDbGrid using OCR. The idea was to move the content via the vertical scrollbar if the text is not found till the last position is reached.

After hours of trying I have found how my script misteriously fails: after the OCR fails to find the text in this line:

 

myRecognizedText = OCR.Recognize(Aliases.EuroTC.dlgEllenor.pcEllenor.tsUfEll.nxgUfEll).BlockByText("10   Teszt");

 

where "10  Teszt" is initially not in the content area, Aliases turns into Value = "Aliases is not defined" in the Watch list, and the line

Aliases.EuroTC.dlgEllenor.pcEllenor.tsUfEll.nxgUfEll.VScroll.Pos = myPos

a bit later fails.

 

Why this happens?

 

PS: It would be cool if the debugger could catch exceptions just like the Delphi 7 debugger does (it catches even the handled ones). I had to surround it with try..catch to even get to know that an exception happened.