Defines the parameters of a Genstat procedure with information to allow them to be checked when the procedure is executed.
No options
Parameters
NAME = texts |
Names of the parameters |
---|---|
MODE = string tokens |
Mode of each parameter (e , f , p , t , v , as for unnamed structures); default p |
NVALUES = scalars or variates |
Specifies allowed numbers of values |
VALUES = variates or texts |
Defines the allowed values for a structure of type variate or text |
DEFAULT = identifiers |
Default values for each parameter |
SET = string tokens |
Indicates whether or not each parameter must be set (yes, no ); default no |
DECLARED = string tokens |
Indicates whether or not the setting of each parameter must have been declared (yes, no ); default no |
TYPE = texts |
Text for each option, whose values indicate the types allowed (ASAVE , datamatrix {i.e. pointer to variates of equal lengths as required in multivariate analysis}, diagonalmatrix , dummy , expression , factor , formula , LRV , matrix , pointer , RSAVE , scalar , SSPM , symmetricmatrix , table , text , tree , TSAVE , TSM , variate , VSAVE ); default * meaning no limitation |
COMPATIBLE = texts |
Defines aspects to check for compatibility with the first parameter of the directive or procedure (nvalues, nlevels, nrows, ncolumns, type, levels, labels {of factors or pointers}, mode, rows, columns, classification, margins, associatedidentifier, suffixes {of pointers}, restriction ) |
PRESENT = string tokens |
Indicates whether or not each structure must have values (yes, no ); default no |
INPUT = string token |
Whether the parameter only supplies input information to the procedure (yes , no ); default no |
Description
The PARAMETER
directive is used at the start of the definition of a Genstat procedure (initiated by the PROCEDURE
directive) to define the parameters of the procedure. The NAMES
parameter defines the names of the parameters. Each name also defines the identifier of a data structure that should be used, within the procedure itself, to refer to the information transmitted by the relevant parameter. When you use the procedure, you have the choice of typing each name in capital letters, or in small letters, or in any mixture of the two; this corresponds to the rules for the names of options and parameters of directives. Within the procedure, however, you need to be more precise, but the exact form of the identifiers will depend upon whether the Genstat environment was set to use short or long “wordlengths” when the procedure was defined. (This is controlled by the WORDLENGTH
option of the JOB
, SET
and PROCEDURE
directives.) With long wordlengths, the identifier should be exactly the same as the parameter name up to the 32nd character; any characters beyond the 32nd are ignored. Alternatively, if short wordlengths have been selected, Genstat forms each identifier by truncating the corresponding option name to no more than eight characters and then converting it into capital letters. The data structures within the procedure are either all dummies or all pointers, according to the setting of the PARAMETER
option of the PROCEDURE
directive. If they are pointers, they store all the settings, and the procedure is called only once; if they are dummies, the procedure is called once for every item in the lists.
The other parameters of PARAMETER
allow the settings that are supplied, when the procedure is called, to be checked automatically similarly to those of the OPTION
directive (where more details are given). The MODE
parameter tells Genstat whether the setting of each parameter is to be a number (v
), or an identifier of a data structure (p
), or a string (t
), or an expression (e
), or a formula (f
). These codes are exactly the same as those that indicate the mode of the values to appear within the brackets containing an unnamed structure. The NVALUES
parameter indicates how many values the structures that are supplied for a parameter of mode p
may contain. The VALUES
parameter can be used with modes t
and v
to specify an allowed set of values against which those supplied for the parameter will be checked. The DEFAULT
parameter specifies default values to be used if the parameter is not set, and the SET
parameter indicates whether or not a parameter must be set. The DECLARED
parameter specifies whether or not the structures to which options or parameters of mode p
are set must already have been declared. The TYPE
parameter can be used to specify a text to indicate the allowed types of the structures to which an option or parameter of mode p
is set. The PRESENT
parameter allows you to indicate that the structure to which an option or parameter is set must have values. Finally, the INPUT
parameter allows you to indicate that the parameter will be used only to provide input to the procedure, and will not be used to output any results. It is not essential to set INPUT
but its use can improve efficiency.
Options: none.
Parameters: NAME
, MODE
, NVALUES
, VALUES
, DEFAULT
, SET
, DECLARED
, TYPE
, COMPATIBLE
, PRESENT
, INPUT
.
See also
Directives: PROCEDURE
, OPTION
, CALLS
, ENDPROCEDURE
.
Commands for: Program control.
Example
" Example 1:5.3.2, 1:5.4.4 " PROCEDURE '%TRANSFORM' " Define the arguments of the procedure." OPTION NAME='METHOD'; MODE=t;\ VALUES=!t(Logit,Comploglog,Angular);\ DEFAULT='LOGIT' PARAMETER NAME='PERCENT','RESULT';\ MODE=p; SET=yes; DECLARED=yes,no;\ TYPE=!t(scalar,variate,matrix,symmetric,diagonal,table);\ COMPATIBLE=*,!t(type,nvalues);\ PRESENT=yes,no IF METHOD .EQS. 'Logit' CALCULATE RESULT = LOG( PERCENT / (100-PERCENT) ) ELSIF METHOD .EQS. 'Comploglog' CALCULATE RESULT = LOG( -LOG((100-PERCENT)/100) ) ELSIF METHOD .EQS. 'Angular' CALCULATE RESULT = ANGULAR(PERCENT) ENDIF ENDPROCEDURE VARIATE [VALUES=10,20...90] Every10% " default setting 'logit' for METHOD " %TRANSFORM Every10%; RESULT=Logit10% PRINT Every10%,Logit10%; DECIMALS=0,3 %TRANSFORM [METHOD=A] 25,50,75; RESULT=Ang25,Ang50,Ang75 PRINT Ang25,Ang50,Ang75 COMMANDINFORMATION '%TRANSFORM','CAPTION','DOTPLOT','NOTONE';\ IMPLEMENTATION=tranimp,capimp,dotimp,notimp;\ CHANNEL=tranchan,capchan,dotchan,notchan;\ PRESENT=trancheck,capcheck,dotcheck,notcheck PRINT tranimp,tranchan,trancheck & capimp,capchan,capcheck & dotimp,dotchan,dotcheck & notimp,notchan,notcheck