The error statement is a way of generating an error that will be caught by the OnError label. It is possible to use this statement at any point in a statement block, include after the OnError label ( in which case it will be caught by the next block out ).
errrorstmt ::= Error etypeexpr , textexpr ;
The etypeexpr expression should yield a value that is of type EReportCat. This is a system defined enumerated type. A lot the error codes should only really be used by the system itself. It is recommended that the user uses just the following : BadParam, OutOfRange, UsingNull and Invalid. This value must not be Null.
The textexpr expression should yield a value of type Text. It may be the empty string, "", but it must not be Null.
If n < 0 Or n > 100 Then Error OutOfRange, "should be in range 0 to 100"; EndIf;