Summary of Programming Constructs
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-End for Grouping Expressions BEGIN e1; e2; …
ei END
A group of expressions to be evaluated in sequence Begin-End for Grouping Expressions (e1; e2; … ei)
Another way to group expressions Begin-End for Grouping Expressions m..n
Generates a list of successive integers from «m» to «n» Functions Expecting Atomic Parameters Var x := e
Define local identifier «x» to refer to the value that results from evaluating «e» Defining a Local Value Index i := e
Define local index «i» and assign initial value «e» Local Indexes x := e
Assigns the result from evaluating «e» to local value «x». Returns value «e».
Assigning to a Local Value While Test
Do Body
While «Test» is True
, evaluate «Body» and repeat.Returns last value of «Body».
While(Test) Do Body { comments }
/* comments */
Curly brackets { } and /* */ are alternative ways to enclose «comments» to be ignored by the parser. Procedural Programming Example 'text' '
"text"
You can use single or double quotes to enclose a literal «text» value, but they must match. Text values 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 «e» with the same indexes as «a».
For i := a Do expr 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» …] For i := a Do expr \e
Creates a reference to the value of expression «e». References and Data Structures \[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» …. References and Data Structures #r
Returns the value referred to by reference «r». References and Data Structures
See Also
- Expression Assist
- Expression Syntax
- Using References
- Function calls and parameters
- User-Defined Functions
- Evaluate
Comments
Enable comment auto-refresher