UseOCREngine – System Function**





UseOCREngine Function


Syntax

ret=UseOCREngine(1)
ret=UseOCREngine(2)

Parameter

  • UseOCREngine(1) : The subsequent OCR function calls will use the MODI OCR engine.
  • UseOCREngine(2) : The subsequent OCR function calls will use the WinTask OCR engine.

Return Value

Ret, numeric return code. If the specified OCR engine is ready for use, the return code is 0. If the specified OCR engine is not ready (typically, MODI from Microsoft Office, is not installed), the return code is 1. If #IgnoreErrors=0 (default value), an error message is returned and script execution stops. If #IgnoreErrors=1, the function returns the error code 1 and script execution goes on.

Remarks

When the OCR engine is not specified within a script, the OCR function calls use the WinTask OCR engine.

If UseOCREngine is invoked in the middle of a script, the subsequent OCR function calls use the new value for the OCR engine.

See Also

  • CaptureAreaOCR$
  • CaptureOCR$
  • ClickOnTextOCR
  • Pause on OCR Text

Examples


var$=CaptureOCR$("NOTEPAD.EXE|Edit|Untitled - Notepad|1",1)
'var$ returns the OCRized text which is seen in the Notepad window.
'The OCR engine used is the WinTask one as UseOCREngine is not invoked before.

UseOCREngine(1)
var$=CaptureOCR$("NOTEPAD.EXE|Edit|Untitled - Notepad|1",1)
'var$ returns the OCRized text which is seen in the Notepad window.
'The OCR engine used is the MODI one.

UseOCREngine(1)
var$=CaptureOCR$("NOTEPAD.EXE|Edit|Untitled - Notepad|1",1,"Japanese")
'var$ returns the OCRized text which is seen in an English Notepad window
'using Japanese language for the text within the notepad window.
'The OCR engine used is the MODI one.