Accesses details of the “environment” of a Genstat job.
||Pointer given unit labels
||Pointer given unit labels
||To save the last input statement; default
||To save the last fault code; default
||Saves the fieldwidth currently defined as the default minimum for
||Saves the minimum number of significant figures currently to be supplied in the default formats determined by
||Saves a pointer to variates defining the seeds currently used as defaults by random-number functions, the
||To obtain the value of the smallest x (on this computer) such that 1+x > 1 ; default
||Number of the current job within the program; default
||Information about the version of Genstat that is being used; default
||Gets an integer value unique in the current job to use, for example, in names of temporary files|
||Saves the name of the current working directory|
GET directive allows you to access the current settings of the environment. This can be particularly useful in procedures, when details of the environment may need to change and be reset later to their original state. Sometimes it may be sufficient just to use the
RESTORE option of the
PROCEDURE directive for this purpose, but this causes them to be reset only at the end of a procedure.
SPECIAL options of
GET are used to access and save the current settings of options of the
SET directive. The options of
SET are divided into two groups. Those that apply to the general environment can be saved using the
ENVIRONMENT option: these are
LANGUAGE.Those that apply only to the save structures associated with particular directives can be saved using the
SPECIAL option: these are
VSTRUCTURE. The labels of the pointer can be specified in either lower or upper case. or any mixture.
When you use the
ENVIRONMENT option, Genstat sets up a pointer structure with units identified by the labels of the corresponding options of
SET: these labels are
'outprint', and so on. The labels can be specified in either lower or upper case, or any mixture. Each unit of this pointer contains one or more strings, or a scalar, to represent the current setting. Thus, the statement
would set up a pointer called
Env with elements
Env['outprint'], and so on. Each element can also be referred to by its position in the pointer; for example,
Env['inprint'] is the same as
Thus you do not have to know how the environment has been set in order to change it and then restore it; you can use
GET to find out about it, and
SET to change it back. For example, suppose that you wanted to stop temporarily the echoing of statements to the output file in a batch program. In the following program the first
SET statement cancels the echoing, if indeed any echoing is in progress, and the second restores echoing to what it was before the first
SPECIAL option similarly sets up a pointer to save its information. The labels of the pointer are
'blockstructure', and so on. These can again be specified in either lower or upper case, or any mixture. The first element of the pointer is the units structure, or, failing that, the number of units if you have defined it for the current job. Printing the contents of the other elements is not usually informative, as the information is stored in coded form. The last ten elements of the pointer allow you to access the special save structures in the graphical and analysis directives. They are most useful for recovering information about an analysis when you have not already specified an explicit save structure. (Otherwise you would have to do the analysis all over again.) The
SPECIAL option also provides a way of accessing the save structures associated with the analysis-of-variance directives
TREATMENTSTRUCTURE. This facility is used by the
ASTATUS procedure, which may be a more convenient way of accessing these structures.
LAST option is used to save the latest statement that you have input. You can then give the statement again later in the job without having to retype it, though some implementations of Genstat provide a simpler recall facility using the cursor keys. The option has the same effect as setting up a macro containing a single statement, and is accessed in the same way. For example, the statements
PRINT [SERIAL=yes; IPRINT=*; SQUASH=yes] !t('New Data'),Y
would print the data,
Y, under the title
New Data and save the
Prdat. After the next data set is read, the heading
New Data and the new data set are printed in the same format as the previous data set.
FAULT option is used to save the last fault code as a single string in a text structure. (A list of fault code definitions is available in the on-line help provided with most implementations of Genstat.) This option is particularly useful in procedures, in combination with the
FAULT options of
SET, to control the printing of diagnostics.
FIELDWIDTH option saves the fieldwidth currently defined as the default minimum for
SIGNIFICANTFIGURES option saves the minimum number of significant figures currently to be supplied in the default formats determined by
SEEDS option saves a pointer containing variates, each containing four values, which define the seeds currently used as defaults by random-number functions, the
RANDOMIZE directive, and internally by various other directives. The pointer elements are labelled to identify the use of the seeds concerned: for example
'randomize' for random-number functions and the
RANDOMIZE directive respectively.
EPS option is used to obtain the smallest number, ε, such that 1.0+ε is recognized by your computer to be greater than 1.0; this is an indication of the precision of the computer, which can affect the behaviour of some of the algorithms used by Genstat.
EPS can be used, for example, when testing for convergence of iterative algorithms.
NJOB option provides the current job number within the Genstat program. It is used in the start-up file to distinguish between statements to be executed just at the start of the program, and those to be executed at the start of each job.
VERSION option allows you to find out which version of Genstat is being used. This is particularly useful within a general program or procedure. The first element of the pointer is given the label
'release', and is a scalar storing the release number, for example 15.10. The main information is in the integer part and the first decimal place; the second decimal may be used to distinguish between sub-releases with minor changes or corrections. The second element, labelled
'implementation' identifies the machine for which Genstat has been implemented, for example
'SUN'. The third is labelled
'system', and indicates the operating system, for example
'Windows. Finally, there is an element labelled
'version' that may contain further information relevant to particular implementations.
PID option saves a scalar containing an integer value that is unique within the current job. You might want to use this, for example, to define a unique name for a temporary file.
WORKINGDIRECTORY option saves a text containing the name of the current working directory.
Commands for: Program control.
" Example 1:5.6.2 " GET [ENVIRONMENT=Env] PRINT [RLWIDTH=24; ORIENT=across; SQUASH=yes] Env; FIELD=16