The @@Lx command returns a number representing the line in a calculation script or formula where a macro argument occurs, or the line where the macro name occurs.
@@Lx
Where x is a number specifying a macro input argument number (1 , 2, ... n ), or the macro name, if zero (0) is specified.
The @@Lx command can be used only as the first parameter of an @@ERROR statement to identify a line number for an error in a calculation script or formula.
The following example macro 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. The line number is specified using the @@L1 statement, which returns 2, the number of the line in the calculation script or formula where the first parameter of the macro occurs.
Calculation script using macro @AVGS 1: "Average_Revenue" = @AVGS( 2: SKIPNONE, 3: @CHILDREN(YrlyRevenue) 4: ); ----------------------- @AVGS macro definition: @@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