1: #line 5992 "./lpsrc/flx_tutorial.pak" 2: //Check formatting:interpolation 3: #import <flx.flxh> 4: 5: var x = "Hello"; 6: var y = "World"; 7: var u = 41; 8: 9: var z = q"$x $(y) $(1+u) $'2+u'\n"; 10: 11: print z;
1: Hello World 42 43
Inside the string, the '$' character introduces an expression which is evaluated, converted to a string using the 'str' function, and replaced by that string.
The expression may begin with a '(', in which case it proceeds up to the balancing ')'. You should note the scan for brackets ignores other characters, in particular quote marks, so this form does not allow you to embed another string containing an unbalanced bracket.
The expression may begin with a double quote, single quote, or backtick, in which case it consists of the text up to the next occurence of the same kind of quote mark.
Finally, you can just write a Felix identifier, starting with a letter or underscore, and continuing with any letter, underscore, digit, or single quote mark.