TabNotNumberException.CreateEx

Syntax

CreateEx;

Description

The CreateEx constructor creates an instance of the error containing the text #VAL!.

Comments

This constructor is used to create an instance of the error containing the text #VAL!. Message text is localized in system resources of the Foresight Analytics Platform, thus the message returned in the Message property depends on the current language of the platform interface.

Example

Public Function Test(A, B: Variant): Variant;
Begin
    If A.VarType <> B.VarType Then
        Raise New TabNotNumberException.CreateEx;
    Else
        Return A + B;
    End If;
End Function Test;

The example is a macro for a regular report. The macro runtime checks types of the passed parameters. If all the parameters have the same type, the function returns sum of parameter values. If the types differ, the function throws an exception. When an exception is thrown, the table cell shows error text. When Foresight Analytics Platform uses the Russian language, the error text is #ЗНАЧ!, when the platform uses the English language, the error text is #VAL! and so on.

See also:

TabNotNumberException