Oberon || Library || Module Index || Search Engine || Definition || Module
TYPE Identifier = ARRAY 32 OF CHAR; TYPE Event = POINTER TO EventRec; TYPE EventRec = RECORD (Events.EventRec) object: RelatedEvents.Object; module: Identifier; proc: Identifier; END; TYPE EventType = POINTER TO EventTypeRec; TYPE EventTypeRec = RECORD (Events.EventTypeRec) END;
VAR failedAssertion: Events.EventType;
PROCEDURE Define(VAR type: Events.EventType; module: ARRAY OF CHAR); PROCEDURE Raise(object: RelatedEvents.Object; type: Events.EventType; proc: ARRAY OF CHAR; text: ARRAY OF CHAR);
Define creates an event type for the given module and should be called during initialization time. Initially, the priority is set to Priorities.assertions.
Raise raises failedAssertion with priority Priority.assertions. Further, an event of the given type is passed to RelatedEvents. Both events contain all paramters of Raise and the module identifier which has been passed to Define. By default, failedAssertion is ignored.
IF (* failure detected? *) THEN Assertions.Raise(...); END;by
ASSERT( ~(* failure detected? *) );ASSERT calls in case of failures RTErrors.FailedAssertion which, in turn, raises an event of the type RTErrors.error[RTErrors.assertion] (see RTErrors).
Oberon || Library || Module Index || Search Engine || Definition || Module