Adding Clauses to an Object Definition

When you add clauses to an object definition, the object becomes an executable function. A function is executed by processing each of the clauses in the object definition in the order that they appear. If the execution of a clause produces a result that is not null, that result is the expression returned by the function. Otherwise, execution continues with the next clause in the object definition. If none of the clauses produce a result other than null, then execution of the function returns null.

To add a clause to an object, right-click the object and select Add function from the context menu, or highlight the object definition and press Ctrl + Insert. A new clause is inserted into the object definition.

At this point, you can edit the clause like any other expression.

To add an additional clause to the implementation, highlight an existing clause and press the Enter key

To delete a clause, highlight the clause and press the Delete key. To delete the contents of the clause but leave an empty box, press Ctrl + Delete.

Clauses can also be enabled and disabled. Disabling a clause is equivalent to commenting out code in other programming languages. Clauses in an object definition can be disabled by right clicking and selecting Disable clause, or by selecting the clause and pressing the F9 key. It can also be used to disable all of the clauses in a function if the entire object definition is highlighted.

See Clauses for more details.