---------------------------------------------------
| Type | Bytes | Range |
---------------------------------------------------
| CHAT | 1 | -128 - 127 |
---------------------------------------------------
| BYTE | 1 | 0 - 255 |
---------------------------------------------------
| SHORT | 2 | -32768 - 32767 |
---------------------------------------------------
| INT | 4 | -2147483648 - 2147483647 |
---------------------------------------------------
| FLOAT | 4 | 1.2E-38 - 3.4E+38 |
---------------------------------------------------
| DOUBLE | 8 | 2.2E-308 - 1.8E+308 |
---------------------------------------------------
| COMPLEX | 8 | 1.2E-38 - 3.4E+38 |
---------------------------------------------------
| STRING | n + 1 | |
---------------------------------------------------
Figure 2.1: Data Types
The following rules are applied to variables:
Integer constants can be specified in decimal or hexadecimal notation. Floating point constants contain a decimal point and can have an exponential part preceded by e or E. String constants must be enclosed in a pair of either apostrophes or quotation marks. Complex constants contain the keyword 'COMPLEX' and a real and imaginary part. The imaginary part is optional and assumed to be zero if it is omitted.
Examples:
----------------------------------
| Constant | Type |
----------------------------------
| 120 | Decimal |
----------------------------------
| 0xFF | Hexadecimal |
----------------------------------
| 0.56 | Floating point |
----------------------------------
| 3.6E2 | Floating point |
----------------------------------
| "ABC" | String |
----------------------------------
| 'abc' | String |
----------------------------------
| COMPLEX (3,4) | COMPLEX |
----------------------------------
| COMPLEX (7) | COMPLEX |
----------------------------------
Figure 2.2: Constants
Examples:
A[i] = 5 B[i, j] = 8There are several ways to create arrays in DISGCL:
INT A[10], B[20,10]
vray = { list }
where list is a constant list of integers or floating point numbers separated by commas.
A[i] Element i of array A A[i:j] Array section of size j - i + 1 B[i1:i2, j] Elements i1 to i2 of column j B[:i2, j] Elements 0 to i2 of column j B[i1:, j] Elements i1 to m - 1 of column j B[*, j] The whole column j.