Similar to programming languages such as Fortran and C, high-level language elements can be used within DISGCL. These are variables, operators, expressions, array operations, loops, if and switch statements, user-defined subroutines and functions, and file I/O routines.
An easy to use interface for data input is given to include data into DISGCL jobs. The format of data files is very simple and useful for most DISLIN plotting routines.
Several quick plots are offered by DISGCL which are collections of DISLIN statements to display data with one command.
Command: | DISGCL [filename[.gcl]] [args] [options] |
filename | is the name of a DISGCL script file. The extension '.gcl' is optional. |
args | are optional arguments that can be passed to DISGCL scripts. The arguments are stored in the system variables %ARG1, %ARG2, ..., %ARGn, or can be requested with the function GETARG (i), 1 <= i <= n. The number of passed arguments is stored in the system variable %NARGS. |
options | is an optional field of keywords separated by blanks: |
-D=device | defines the format of the metafile created by DISLIN. This parameter will overwrite the keyword in the DISLIN routine METAFL and can have the same values as the parameter in METAFL. |
-F=file | defines the file used for data input. This parameter will overwrite the file parameter in the routine DATFIL. |
-I=file | replaces the file parameter of the first INCLUDE statement in a DISGCL script file. This option can be used to initialize variables with different values. |
-f | means that the extension '.gcl' is not added to the filename. |
-o | opens a console window on Window systems. |
-v | prints program version and author. |
Additional notes:
#! /path/disgcl -f
where path is the directory containing the disgcl executable.
%GCL SUM = 0 DO I = 1, 10 SUM = SUM + I END DO PRINT SUM
----------------------------------------------------------- | %GCL | Identifier for DISGCL | | | script files. | ----------------------------------------------------------- | // comment or # Comment | Comment line and inline | | | comments. | ----------------------------------------------------------- | Routine (parameter list) | Call of a DISLIN or DIS- | | | GCL routine | ----------------------------------------------------------- | CALL routine (param. list) | Call of a user-defined | | | subroutine. | ----------------------------------------------------------- | v = function (parameter | Call of a DISLIN, DISGCL | | list) | or user-defined function. | ----------------------------------------------------------- | v = expression | Assigns the value of the | | | expression to the variable | | | v. | ----------------------------------------------------------- | Command [parameter list] | DISGCL command. | | | | ----------------------------------------------------------- | vray = { constant list } | Creates and initializes an | | | integer or floating point | | | array. | ----------------------------------------------------------- | if (expression) statement | IF statement (conditional | | | statement). | ----------------------------------------------------------- | if (expression) | IF construct. Up to 8 IF | | statements | constructs can be nested. | | else if (expression) | The ELSE IF and the ELSE | | statements | parts are optional. | | else | | | statements | | | end if | | ----------------------------------------------------------- | do v = expr1, expr2 | DO loop. Up to 8 loops can | | [,expr3] | be nested. | | statements | | | end do | | ----------------------------------------------------------- | while (expr) | WHILE loop. Up to 8 loops | | statements | can be nested. | | end while | | ----------------------------------------------------------- | switch (iexpr) | SWITCH statement where | | case n1: | iexpr must be an integer | | statements | expression and n1, n2, ... | | case n2: | integer constants. | | statements | Up to 8 SWITCH statements | | ...... | can be nested. | | default: | | | statements | | | end switch | | ----------------------------------------------------------- | label: | Label statement. | ----------------------------------------------------------- | goto label | GOTO statement. | ----------------------------------------------------------- | $command | Executes a system command. | ----------------------------------------------------------- Figure 1.1: DISGCL Statements
CHAR | an 8-bit integer in the range -128 to 127. |
BYTE | an 8-bit integer in the range 0 to 255. |
SHORT | an 16-bit integer in the range -32768 to 32767. |
INT | an 32-bit integer in the range -2147483648 to 2147483647. |
FLOAT | an 32-bit floating point number in the range 1.2E-38 to 3.4E+38 and with 7-digit precision. |
DOUBLE | an 64-bit floating point number in the range 2.2E-308 to 1.8E+308 and with 15-digit precision. |
COMPLEX | a pair of 32-bit floating point numbers in the range 1.2E-38 to 3.4E+38. |
STRING | a sequence of characters. Strings are stored as CHAR arrays terminated with the ASCII value zero. |
Example:
a = 60
x = exp (sin (a * 3.14159))
Example:
x = falloc (100)
plot x, sin (x/5)
Figure 1.1: Example of the PLOT Command
Additional note:
disgcl quickplot
where quickplot is the name of a quick plot. The widget interfaces for quick plots expect data in the form of data files described in chapter 8, 'Data Files'.