1. Home
  2. COMMANDINFORMATION directive

COMMANDINFORMATION directive

Provides information about whether (and how) a command has been implemented.

No options

Parameters

NAME = texts Single-line texts supplying the names of the commands
IMPLEMENTATION = texts Single-line texts set to ‘directive‘, ‘procedure‘ or a null string (' ') according to the type of command
CHANNEL = scalars Saves the channel for a procedure from a procedure library
PRESENTNOW = scalars Logical set to one if the command is nowpresent, or zero otherwise

Description

COMMANDINFORMATION enables you to discover whether a command is present in your version of Genstat and, if so, whether it is a directive or a procedure.

The name of the command must be supplied in a single-value text, using the NAME parameter. The IMPLEMENTATION parameter can save another single-valued text, which is set to ‘directive‘ or ‘procedure‘ according to the type of command. If the command is not present, it is set to a null string (' ') .

The PRESENTNOW parameter provides another, possibly simpler, way of discovering whether the directive or procedure is currently present within Genstat. This saves a scalar containing the value one if the command is present, or zero otherwise.

For procedures accessed from a procedure library, the CHANNEL option can save a scalar with the number of the channel to which the library is attached. This contains a missing value if the command is not present as a procedure. It contains zero if the procedure was created in this job (using the PROCEDURE directive). The channel number for the official procedure library is 12, and the channel for the local procedure library is 11.

Parameters: NAME, IMPLEMENTATION, CHANNEL, PRESENTNOW.

See also

Directives: OPEN, PROCEDURE, SYNTAX.
Procedures: SPSYNTAX.
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
Updated on October 28, 2020

Was this article helpful?