Home > Articles > SetWarningsOn function in RoutineBot

SetWarningsOn function in RoutineBot

June 18th, 2009

Function SetWarningsOn enables or disables Exceptions searching. If these function is enabled, then after each event or function Interpreter will be search an error window, and if this window is found then to it sends event, that emulates click on ‘OK’ botton.

Interpreter finds 2 kinds of error symptoms

1)  Window that caption contains string ‘Access violation’

or

2) Window, that contains error icon.

E.g. in Windows XP it look so   error xp

and In Vindows Vista it look so  errorvista

Syntax

SetWarningsOn( WarningsON:String )

Parameters

WarningsON:String

If  WarningsON is 1 or ‘ON’ then function enables exceptions searching, otherwise if WarningsON is 0 or ‘OFF’ then function disables exceptions searching.

Example

For this example you must download errorsample application, that raises an exception.
SetWarningsOn('ON');
Execute('c:\ErrorSample.exe');
Wait(1000);
ClickButton('Run divide error');
//error, cathed
SetWarningsOn('OFF');
ClickButton('Run divide error');
//error, not cathed

Download example SetWarningsOn

  • Share/Bookmark

Developer Articles

  1. No comments yet.
  1. No trackbacks yet.