1. Home
  2. WORKSPACE directive

WORKSPACE directive

Accesses private data structures for use in procedures.

No options

Parameters

NAME = texts Texts, each containing a single line, to give the names used to identify the private data structures
DUMMY = identifiers Dummy structure to be used to refer to each private data structure

Description

The WORKSPACE directive is intended particularly for writers of procedures. It allows data to be accessed within a number of procedures, and in the main program if needed. You merely need to decide how to label your workspace “areas”. Genstat reserves a data structure for each one, and WORKSPACE allows you to link this to a dummy (of your choice) within any procedure or in the outer program itself. For example

WORKSPACE 'AUNBALANCED work'; Wspace

TEXT [VALUES=Yvar,Factopt] Wlabels

POINTER [NVALUES=Wlabels] Wspace

VARIATE Wspace['Yvar']

SCALAR Wspace['Factopt']

names the area 'AUNBALANCED work' and sets the dummy Wspace to the associated data structure. The data structure is then defined to be a pointer with two values, the variate Wspace['Yvar'] and the scalar Wspace['Factopt']. A similar WORKSPACE statement can then be used later on (in another procedure) to access the same information. For example

WORKSPACE 'AUNBALANCED work'; Abwork

links the dummy Abwork to the pointer, allowing us to refer to Abwork['Yvar'] and Abwork['Factopt']. This will be used particularly within the Genstat Procedure Library, to link suites of associated procedures so, for safety, you should avoid prefixing the name of any workspace of your own by G5PL.

Options: none.

Parameters: NAME, DUMMY.

See also

Directives: PROCEDURE, DUMMY, POINTER.

Commands for: Program control.

Updated on June 14, 2019

Was this article helpful?