1. Home
  2. EXAMPLE procedure

EXAMPLE procedure

Obtains and runs a Genstat example program, PC Windows only (R.W. Payne).

Option

EXECUTE = string token Whether to run the example when Genstat is running interactively (no, yes); default no

Parameters

EXTYPE = texts Types of example
EXNAME = texts Names of example
SOURCE = texts Texts to store the source code of each example
STATEMENT = texts Saves a command to obtain each example (useful if the name and type information has been specified in response to questions from EXAMPLE)

Description

EXAMPLE provides a convenient way of accessing the example programs that are distributed with Genstat. EXAMPLE is easiest to use interactively (and this is what happens if you select Help followed by Example Programs from the menu bar of Genstat for Windows). It then lists the types of example, followed (once you have selected the type) by a list of the available examples. If, however, you wish to access the same example later, the STATEMENT parameter allows you to save a Genstat text structure containing a command specifying the necessary EXTYPE and EXNAME parameters. For example

EXAMPLE 'plib'; 'GLMM'

obtains the example for the GLMM procedure (the plib module contains all the procedures in the current library).

When you are running Genstat interactively, the example is put into a new input window. If the EXECUTE option is set to yes, the example will also be executed. If EXECUTE is not set, you will be asked if you want to run it. When Genstat is running in batch, the example is printed to the output window (and cannot be executed). You can also save the example in a Genstat text structure, using the SOURCE parameter.

Option: EXECUTE.

Parameters: EXTYPE, EXNAME, SOURCE, STATEMENT.

See also

Directive: HELP.

Procedure: LIBEXAMPLE.

Updated on June 19, 2019

Was this article helpful?