Functions
Introduction
A function is a construct for providing advanced functionality inside of a clause. As in mathematics, a function typically accepts some sort of input, performs an operation, and returns a result.
For example, a hypothetical function could accept two numbers and return their sum.
For a list of available functions, visit the function reference.
Anatomy of a function
In ESCL, all functions are comprised of two parts: a name in uppercase and an arguments clause wrapped in parenthesis.
In this example, the function's name is LINK
and its arguments clause is :myText, :myUrl
.
Working with functions
A function may be included in a clause, just like a variable or string identifier. In fact, you can use them together:
Then, when we translate the string, we pass in some variable values:
And that's it! We've created a hyperlink directly in our string:
Nesting functions
Sometimes, you may want to call multiple functions on the same piece of text. For this, you can nest multiple function calls, and they will be executed in order.
In this example, we want to create a link that is also bold:
Then, when we translate the string, we pass in some variable values:
Voila! We've used both functions together to provide a result that is bold and linked:
Last updated