Example 1:
var myinfo = "age";
var age = 18;
display "What is your {myinfo}?
"; // What is your age?
display "I'm {{myinfo}}.
"; // I'm 18.
Example 2:
// "customer" is a database select result currently
// pointing to a man called Peter Smith.
var person = "(database)customer";
var sexName = "(array)M=>Male,F=>Female";
var title = "(array)Male=>Mr,Female=>Ms";
display "Hello, {title:{sexName:{person:Sex}}} {person:Name}";
// Output: Hello, Mr Peter Smith
Example 3:
var abc = "IAmFine";
// {abc} -> IAmFine
// {abc|words} -> {abc:|words} I Am Fine
// {#abc} -> 1 (as the array has only one element)
// {#abc:} -> 7 (and that element evaluates to 7-char string)
// {#abc:|words} -> 9 (and it is "I Am Fine", 9-char long)
Please note that ${#myname} returns the number of elements in the myname array, and ${#myname:} returns the length of its default element (the one indexed by blank in the myname array). That's why from the above example, {#abc} evaluates to 1 and {#abc:} evaluates to 7.
|