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 quickplots are offered by DISGCL which are collections of DISLIN statements to display data with one command.
#! /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 floatingpoint | | | 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
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
Note:
disgcl quickplot
where quickplot is the name of a quickplot. The widget interfaces for quickplots expect data in the form of data files described in chapter 8, 'Data Files'.