Summary of Programming Constructs
Revision as of 13:02, 15 December 2015 by Jhernandez3 (talk | contribs) (Created page with "Category: Analytica User Guide <breadcrumbs> Analytica User Guide > {{PAGENAME}}</breadcrumbs><br /> Please see the table below for a list of Analytica programming constr...")
Please see the table below for a list of Analytica programming constructs, their meanings, and links to references with more details, if available.
Construct | Meaning: | For more, see |
---|---|---|
e1; e2; … ei
|
Semicolons join a group of expressions to be evaluated in sequence | |
BEGIN e1; e2; …
|
A group of expressions to be evaluated in sequence | |
(e1; e2; … ei)
|
Another way to group expressions | |
m .. n
|
Generates a list of successive integers from m to n
|
|
Var x := e
|
Define local variable x and assign initial value e
|
|
Index i := e
|
Define local index i and assign initial value e
|
|
x := e
|
Assigns value from evaluating e to local variable x .
Returns value |
|
While Test Do Body
|
While Test is True, evaluate Body and repeat.
Returns last value of |
|
{ comments }
/* comments */ |
Curly brackets { } and /* */ are alternative ways to enclose comments to be ignored by the parser. | |
'text'
"text" |
You can use single or double quotes to enclose a literal text value, but they must match. | |
For x := a DO e
|
Assigns to loop variable x , successive atoms from array a and repeats evaluation expression e for each value of x .
Returns an array of values of |
|
For x[i, j…] := a DO e
|
Same, but it assigns to x successive sub-arrays of a , each indexed by the indices, [i, j …
|
|
\ e
|
Creates a reference to the value of expression e .
|
|
1
|
VAR result := [1];
|
|
\ [i, j …] e
|
Creates an array indexed by any indexes of e other than i, j … of references to sub-arrays of e each indexed by i, j ….
|
|
# r
|
Returns the value referred to by reference r .
|
Comments
Enable comment auto-refresher