gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm2] ISO exceptions source


From: Martin Kalbfuß
Subject: [Gm2] ISO exceptions source
Date: Wed, 23 Sep 2009 02:29:43 +0200

Hi,

I try to use exceptions.

I do for example:

PROCEDURE VectorAddition(Vector1, Vector2 : ARRAY OF REAL;
                         VAR Result       : ARRAY OF REAL);
VAR
        Index  : CARDINAL;
        Source : EXCEPTIONS.ExceptionSource;
BEGIN
        IF HIGH(Vector1) <> HIGH(Vector2) THEN
           EXCEPTIONS.AllocateSource(Source);
           EXCEPTIONS.RAISE(Source, 1, 'Error: Vectors of different size');
        END;
        FOR Index := 0 TO HIGH(Vector1) DO
            Result[Index] := Vector1[Index] + Vector2[Index];
        END;
END VectorAddition;


Is there anything I should do with the Source? Or should I only allocate
it?







reply via email to

[Prev in Thread] Current Thread [Next in Thread]