predefined 

algebra: variables: predefined


BATCH

A global variable of type Logical which is set to True if Garfield is currently run in batch and which is set to False if the program runs interactively.

A program is said to run in batch if the standard input stream is anything else than terminal input. For instance, running under Unix with input taken from a file (e.g. by typing garfield < input) will result in BATCH being set to True.


FRAME

Stores the sequential Number of the plot frame. The first frame produced during a run has number 1, the number is incremented by one every time a new frame is opened.

This variable is meant to be used in conjunction with the SINGLE-FRAME-FILE option when opening a workstation which should only receive one frame per file, such as an Encapsulated PostScript file.

You may change the value of this variable, but not its type.


INPUT

A String that contains the name of the current input file.

The variable has a value of "Standard input" when input comes from standard input. The value changes while an initialisation file is read, and also whenever you use input redirection.

This variable can be used to construct automatically a name for a metafile:

If input#`Standard input` Then
   !add meta type PostScript file-name "{input}.ps"
   !open meta
   !act meta
Else
   !add meta type PostScript file-name "garfield.ps"
   !open meta
   !act meta
Endif

INTERACT

A global variable of type Logical which is set to False if Garfield is currently run in batch and which is set to True if the program runs interactively.

A program is said to run interactively if the standard input stream is terminal input. INTERACT will be set to True if you start Garfield by simply typing the name of the executable, but INTERACT will be set to False if input is taken from a file (e.g. by typing garfield < input).


MACHINE

A global variable of type String which contains the type of computer for which the executable has been produced.

Currently, the following values can be returned:

Value Meaning
Apollo Apollo systems running SR 10
CMS VM/CMS, an IBM operating system
Cray Cray running UNICOS
MVS MVS, an IBM operating system
Vax Vax or Alpha systems running VMS or OpenVMS
Unix Various Unix systems, including Linux
< not known > Unidentified system

OK

A Logical that tells whether the last algebraic operation was successful.

Most procedures and also several regular commands set this variable depending on the success of the calculations requested.


OUTPUT

A String that contains the name of the current output file.

The variable has a value of "Standard output" when output is sent to the standard output stream. The value changes whenever you use output redirection.


TIME_LEFT

The time left, expressed in seconds.

Time limits are relevant mostly while running in batch and checking this variable permits graceful termination of iterative calculations.

This variable is of type Number.


X

A parameter used amongst others by the FIT_FUNCTION procedure.

This is a Number which may be modified by the user, but its value can at any moment be overwritten by the program.


Go to the top level, to algebra, to variables, to predefined, to the topic index, to the table of contents, or to the full text.

Formatted on 21/01/18 at 16:55.