[ Command Language Format ]
[ Data Types ]
The ALADDIN command language corresponds to individual statements, and sequences of statements.
statement 1; statement 2; ........ statement N;
Each statement ends with a semi-colon (;).
Comment Statements
As with C, comment statements are enclosed between /* .... */ , as in
/* * ========================================================= * Here is a comment that introduces a block of N statements * ========================================================= */ statement 1; /* the first ALADDIN statement */ statement 2; /* the second ALADDIN statement */ ........ statement N; /* the n^th ALADDIN statement */
Last Statement : The last statement in an ALADDIN session should be
quit;
ALADDIN support three data types, character strings, physical quantities, and matrices of physical quantities. Here are some examples of each type:
Character Strings
A character string is simply a sequence of characters enclosed between quotes. To print the character string
"My First Character String"just type something like
print "My First Character String\n";The end-of-line character (\n) forces output onto a new line.
Physical Quantities
A physical quantity is a number plus a set of physical units. For example, the script
2 cm/sec;defines a velocity of two centimeters-per-second. In ALADDIN, numbers are simply physical quantities without dimensions.
Matrices
In ALADDIN a matrix is a rectangular array of physical quantities. For example, the statement
A = [ 1, 2, 3; 4, 5, 6 ];defines a (2x3) array of numbers. The script
Spectra = [ 0.0 sec, 10.0 cm/sec/sec; 0.1 sec, 12.3 cm/sec/sec; 0.2 sec, 12.3 cm/sec/sec; 0.4 sec, 5.0 cm/sec/sec ];defines a (4x2) array of physical quantities. Entries in the first and second columns have units of time and acceleration, respectively. The command
PrintMatrix ( Spectra );generates the output
MATRIX : "Spectra" row/col 1 2 units sec m/sec^2 1 0.00000e+00 1.00000e-01 2 1.00000e-01 1.23000e-01 3 2.00000e-01 1.23000e-01 4 4.00000e-01 5.00000e-02