Forms lists of arguments involved in an expression.
||Expression whose arguments are required|
||Number of results generated by the expression|
||Number of calculations in the expression|
||The calculation from which to save the result and arguments|
||Stores the result structure for calculation
||Stores the arguments in calculation
FARGUMENTS directive allows you to access the data structures involved in a Genstat expression. For example, the expression
P = R / N
defines a calculation involving the data structures
N, and stores the results in the data structure
P. An expression can contain lists, to define several calculations. For example,
P1,P2 = R1,R2 / N1,N2
has two results,
P2, that are calculated as
R2/N2 respectively. Some expressions may have no results, for example
This could then be used as part of a
CALCULATE statement, as in the following program
EXPRESSION [VALUE=LOG(P1/(1-P1))] Transformation
CALCULATE Y = #Transformation
If you are writing a procedure that takes an expression as one of its inputs, you may want to know what results it is generating and what data structures it is using to calculate them. The
FARGUMENTS allows you to find this out.
The expression to study is specified by the
EXPRESSION option. The
NRESULTS option can save the number of results, and the
NCALCULATIONS option can save the number of calculations. The parameters of
FARGUMENTS allow you to save information about each of the calculations in the expression: the
ICALCULATION parameter specifies the number of the calculation, the
RESULT parameter can specify a dummy to be set to the structure that is given the result, and the
ARGUMENTS parameter can specify a pointer to save the arguments.
Commands for: Calculations and manipulation.
" Example 1:4.8.2 " EXPRESSION Sum; VALUE=!e(S=A+B+C+D) FARGUMENTS [EXPRESSION=Sum] 1; RESULT=SumRes; ARGUMENTS=SumArgs PRINT !p(SumRes) PRINT SumArgs SCALAR L1,L2,P1,P2 EXPRESSION Transformation; VALUE=!e(L1,L2=LOG(P1,P2/(1-P1,P2))) FARGUMENTS [EXPRESSION=Transformation; NRESULTS=Nt] FARGUMENTS [EXPRESSION=Transformation] 1...Nt; RESULT=TRes[1...Nt];\ ARGUMENTS=TArgs[1...Nt] FOR [NTIMES=Nt; INDEX=i] PRINT !p(TRes[i]) PRINT TArgs[i] PRINT TArgs[i] ENDFOR