Home > Language Reference > System Functions > UseOCREngine

UseOCREngine

The UseOCREngine function specifies which OCR engine will be used by subsequent OCR function calls .

Usage

Used to change the OCR engine to use (the default one is the WinTask OCR engine).

Syntax

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

Parameters

UseOCREngine(1): the subsequent OCR function calls will use MODI OCR engine.

UseOCREngine(2): the subsequent OCR function calls will use WinTask OCR engine.

Return value

ret, integer, optional return value. If the specified OCR engine is ready for use, the return value is 0. If the specified OCR engine is not ready (typically, MODI from Microsoft Office, is not installed), the return value is 1 and Error Handling mechanism is used.

Remarks

When the OCR engine is not specified within a script, the OCR function calls use 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
How to install MODI OCR engine

Examples

var$=CaptureOCR$("NOTEPAD.EXE|Edit|Untitled - Notepad|1",1) 'var$ returns the OCRized text which is seen in the Notepad window.
'The OCRengine 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 OCRengine 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 OCRengine used is the MODI one.