This function uses optical character recognition (OCR) to synchronize subsequent user actions. Based on provided parameters, this function waits until the provided text pattern appears on the specified location.
Use TrueLog Explorer to insert this synchronization call.
The screen region can be specified absolutely or relatively to a window (by specifying a window handle). When only a window handle, and no position or size, is provided, the region specified by the window outline is used.
In the case of a timeout, error reporting can be prohibited with the bNoError parameter.
CitrixWaitForTextFuzzy performs OCR more exactly than CitrixWaitForText but requires more resources.
CitrixAPI.bdh
true if successful
false otherwise
CitrixWaitForTextFuzzy( in sText : string, in nWindow : number, in nX : number, in nY : number, in nWidth : number, in nHeight : number, in sLanguage : string, in nMatch : number, in nTimeout : number optional, in bNoError : boolean optional, out sResult : string optional, in nPolling : number optional ): boolean;
Parameter | Description |
---|---|
sText | String or string pattern to wait for. |
nWindow | Window handle returned by a call to CitrixWaitForWindowCreation. Use DESKTOP to specify a region relative to the desktop. |
nX | X coordinate of the left margin of the screen region. |
nY | Y coordinate of the top margin of the screen region. |
nWidth | Width of the region. |
nHeight | Height of the region. |
sLanguage | The language of the text to be verified. Possible language codes are chi_sim, dan, deu, eng, fin, fra, ita, jpn, nld, nor, pol, spa and swe. |
nMatch |
Specify one of the following values (optional):
In the optional flag MATCH_IfDifferent is added to the value the function waits until the OCR result does not match the provided string or string pattern any more. |
nTimeout | Specify the time in milliseconds to wait for the screen region to reach the correct appearance (optional). When this parameter is omitted or set to 0, the default timeout is used. The default value can be adjusted by profile settings ( ) or an appropriate call to the CitrixSetOption function. |
bNoError | Set this parameter to true to prevent a timeout from raising an error. This is especially useful for controlling variable user reactions. |
sResult | Retrieves the result of the OCR conversion. |
nPolling | Specify the polling period in milliseconds that the Citrix Replay engine will wait to poll a screen for an update (0 means no polling). If omitted, the parameter is set to 1000. This setting overrides the CitrixSetOption(CITRIX_OPT_ScreenTextPolling) polling interval. |
transaction TMain var sResult : string; begin CitrixInit(800,600); // do not change the resolution CitrixConnect("server","John",Decrypt("8V6F"),"",COLOR_256); CitrixWaitForLogon(); CitrixWaitForTextFuzzy("St*",DESKTOP,20,579,35,16,MATCH_Wildcard, "eng",0,false,sResult); print(sResult); CitrixDisconnect(); end TMain;