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; … eiSemicolons join a group of expressions to be evaluated in sequence Begin-End for Grouping Expressions BEGIN e1; e2; …ei ENDA 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..nGenerates a list of successive integers from «m» to «n» Functions Expecting Atomic Parameters Var x := eDefine local identifier «x» to refer to the value that results from evaluating «e» Defining a Local Value Index i := eDefine local index «i» and assign initial value «e» Local Indexes x := eAssigns the result from evaluating «e» to local value «x». Returns value «e».
Assigning to a Local Value While TestDo BodyWhile «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 eAssigns 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 eSame, but it assigns to «x» successive sub-arrays of «a», each indexed by the indices, [«i», «j» …] For i := a Do expr \eCreates a reference to the value of expression «e». References and Data Structures \[i, j …]eCreates 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 #rReturns 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