Syntax: Defines a variable within the current scope with name identifier of
type Sort, with (optionally) initial value expression. assignments Example: if If the expression is true the first block of code is executed, if it's
false, the second block is executed. The else block is
optional. Example: for Note: the implementation of order by is not stable yet. Example: return Example: In the context of a entity function this returns the expression as the
result of that function. In the context of an action definition, it
tells the action to redirect the user to the page specified in the
expression. goto Example:Action code
Variable declaration
var <identifier> : <Sort> [:= <expression>];
Statements
The syntax of an assignment: <variable> := <value expression>;
p.lastName := "Doe";
The if-statement has the following syntax: if(<expression>) {
<block executed if true>
} [else {
<block executed if false>
}]
if(user.lastName = "Doe") {
msg := "You are unkown";
}
The for-statement has the following syntax: for(<identifier> : <Sort> in <expression> [where <condition>] [order by <expression>]) {
<code to be executed repetitively>
}
for(p : Person in persons where p.lastName = "Doe") {
does.add(p)
}
Syntax: return <expression>;
return p.lastName;
The goto statement (only allowed in the defintion of an action, not in function code) redirects the user to the specified page. Syntax: goto <page>([params]);
goto editPage(p);
Contributions by ZefHemel