The @@ERROR command forces the macro processor to stop and report an error.
@@ERROR( lineNumber , errorCode )
Where:
lineNumber is a number representing a line in the calculation script or formula where the macro is used
errorCode is an error code for the error
The @@Lx command can be used as the first parameter of an @@ERROR statement to identify a line number in a calculation script or formula where the macro is used.
The following example function checks the first input argument for valid values (SKIPNONE, SKIPMISSING, SKIPZERO, SKIPBOTH). If none of these values is found, the macro returns an error, specifying a line number in a calculation script or formula where the macro is used.
@@IFSTRCMP (@@1, SKIPNONE) @_JAVGS (0, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPMISSING) @_JAVGS (1, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPZERO) @_JAVGS (2, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPBOTH) @_JAVGS (3, @@2) @@ELSE @@ERROR (@@L1, @_INVALIDSKIP) @@ENDIF @@ENDIF @@ENDIF @@ENDIF