Library functions differ from subroutines in the following ways:
•They are invoked in the context of an expression.
•Their arguments' values cannot be changed in the function, although if an argument is passed by reference, then this pointer can be used within the function to change the value.
•They return a value that is used in the evaluation of that expression.
To invoke the library functions, reference the function name, followed by its arguments, in your ESL program. Note the following:
•Arguments can be any arbitrary expression, including constants or variables, but they cannot be functions.
•The number of arguments after the function name must match the number of arguments in the declaration.
•The type of each argument will be converted to the specified type in the declaration.
Use the following syntax to reference a function in an ESL program:
FUNC_NAME(ARGLIST)
where FUNC_NAME is the identifier for the function, and ARGLIST contains expressions separated by commas.
If an argument is passed by reference, the ESL developer must ensure that only variables are passed when the function could update the value. Passing a literal or constant to a function, when the value is updated will have unpredictable behaviour.