All of the basic Definition types can also become functions by defining them to accept passed parameters (arguments). The fact that it receives parameters doesn't change the essential nature of the Definition's type, it simply makes it more flexible.
Parameter definitions always appear in parentheses attached to the Definition's name. You may define the function to receive as many parameters as needed to create the desired functionality by simply separating each succeeding parameter definition with a comma.
The format of parameter definitions is as follows:
DefinitionName( [ ValueType ] AliasName [ =DefaultValue ] ) := expression;
If the optional ValueType is any of the simple types (BOOLEAN, INTEGER, REAL, DECIMAL, STRING, QSTRING, UNICODE, DATA, VARSTRING, VARUNICODE), the ValueType may include the CONST keyword (see CONST) to indicate that the passed value will always be treated as a constant (typically used only in ECL prototypes of external functions).
ValueDefinition := 15; FirstFunction(INTEGER x=5) := x + 5; //takes an integer parameter named "x" and "x" is used in the //arithmetic expression to indicate the usage of the parameter SecondDefinition := FirstFunction(ValueDefinition); // The value of SecondDefinition is 20 ThirdDefinition := FirstFunction(); // The value of ThirdDefinition is 10, omitting the parameter