timer class : IsError getter

Description

Returns a value that indicates whether the last execution of the handler finished with the exception.

Syntax

instance.IsError

Arguments

None

Return value

ClassDescription
boolWhether the last execution of the handler finished with the exception.

Sample code

Suppose you have the following class definition.

1:

class handle

2:

open method void THandler(dictionary dic)

3:

throw "exception"; // Exception occurs.

4:

endmethod

5:

endclass

Usage of the IsError getter is as follows.

1:

handle h = new handle();

2:

timer tim = new timer(h,"THandler(dictionary)", 1000);

3:

tim.StopWithException = false; // Non-stop timer handler.

4:

tim.ShowException = false; // No error message dialog.

5:

tim.Start(); // Start timer handler.

6:

sleep slp.

7:

slp.Freeze(10000); // It wait 10sec, the handler will be called and an exception will be thrown.

8:

bool occur = tim.IsError; // It returns true because the handler will throw exception.

Notes

Returns true if the last execution of the handler finished with the exception. Otherwise, returns false.

Links for reference

None.

Copyright © Cooker All rights reserved.