+ operator examples
These examples demonstrate addition and concatenation.
"this &" + " that" // = the string "this & that"
5 + 5 // = the number 10
"this & " + 5 + " more" // = the string "this & 5 more"
5 + "-5" // = the string "5-5"
date( ) + 7 // = same day next week
"" + Form::open // = the string "Function: FORM::OPEN"
? 3 + 4 + "abc" + false // = the string "7abcfalse"
? false + 3 + 4 + "abc" // Error: unexpected type
The last two examples demonstrate the standard left-to-right precedence of the + operator. In the first example, 4 is added to 3, which yields 7. The string "abc" is added, so the number is converted to its display representation, resulting in the string "7abc". Then the value false is added, which is also converted to string, yielding "7abcfalse". But in the second example, the first addition attempts to add 3 to the value false, which is not allowed; an error occurs.