Each ECL definition is the basic building block of ECL. A definition specifies what is done but not how it is to be done. Definitions can be thought of as a highly developed form of macro-substitution, making each succeeding definition more and more highly leveraged upon the work that has gone before. This results in extremely efficient query construction.

All definitions take the form:

[Scope] [ValueType] Name [ (parms) ] := Expression [ :WorkflowService] ;

The Definition Operator ( := read as "is defined as") defines an expression. On the left side of the operator is an optional Scope (see Attribute Visibility), ValueType (see Value Types), and any parameters (parms) it may take (see Functions (Parameter Passing)). On the right side is the expression that produces the result and optionally a colon (:) and a comma-delimited list of WorkflowServices (see Workflow Services). A definition must be explicitly terminated with a semi-colon (;). The Definition name can be used in subsequent definitions:

MyFirstDefinition := 5; //defined as 5
MySecondDefinition := MyFirstDefinition + 5; //this is 10

Definition Name Rules

Definition names begin with a letter and may contain only letters, numbers, or underscores (_).

My_First_Definition1 := 5; // valid name
My First Definition := 5;  // INVALID name, spaces not allowed

You may name a Definition with the name of a previously created module in the ECL Repository, if the attribute is defined with an explicit ValueType.