ENQUIRE directive

Provides details about files opened by GenStat.


No options


Parameters

CHANNEL = scalars
Channel numbers to enquire about; for FILETYPE=input or output, a scalar containing a missing value will be set to the number of the current channel of that type and a negative value can be used to check the existence of a file that is not yet connected to a channel

FILETYPE = strings
Type of each file (input, output, unformatted, backingstore, procedurelibrary, graphics); default inpu

OPEN = scalars
To indicate whether or not the corresponding channels are currently open (0=closed, 1=open)

NAME = texts
External name of the file, if channel is open

EXIST = scalars
To indicate whether files on corresponding channels currently exist (0=not yet created, 1=exist)

WIDTH = scalars
Maximum width of records in each file (only relevant for input and output files, set to * for other types)

PAGE = scalars
Number of lines per page (relevant only for output files)

ACCESS = texts
Allowed type of access: set to 'readonly', 'writeonly' or 'both'

LINE = scalars
Number of the current line (input files only)

STYLE = texts
Underlying style of an output channel: set to 'plaintext', 'html', 'rtf', or 'latex' (see OPEN)

OUTSTYLE = texts
Current style of an output channel: set to 'plaintext' or 'formatted' (see OUTPUT)


Description

ENQUIRE allows you to ascertain whether a particular channel is already in use and, if so, what properties are defined for aspects like the width of each line or the number of lines per page (see the OPEN and OUTPUT directives). This is likely to be of most use within general programs and procedures.

   You specify the channel using the parameters CHANNEL and FILETYPE; the other parameters allow you to save the required information in data structures of the appropriate type.

   ENQUIRE can also be used to discover whether a file exists. You simply set the CHANNEL option to a negative number. The result of the enquiry is supplied by the EXIST parameter. So, for example

ENQUIRE CHANNEL=-1; NAME='lost.dat'; EXIST=Found

will set the scalar Found to one if the file lost.dat exists, or to zero otherwise.


Options: none.

Parameters: CHANNEL, FILETYPE, OPEN, NAME, EXIST, WIDTH, PAGE, ACCESS, LINE, STYLE, OUTSTYLE.


See also

Directives: OPEN, CLOSE.