Expressions in TouchDesigner are functions where you pass it data (string, float, vector etc.) and it returns data (not necessarily the same type as the data passed in). Examples:
sqrt(16)takes a number and returns a number,
strlen("hello")takes a string and returns a number,
base("flower42")is a "string expression" - takes a string and returns a string,
if($F>10,2,3)takes numbers and returns a number.
ifs($F>10,"high","low")takes a mix of numbers and strings, returning a string.
tab("guests",2,3)gets the string in the third row, 4th column of the table
chop("/project1/constant1/chan1")gets the channel named
chan1in the CHOP
A complete listing of all expressions is in the Expressions category.
An important concept to understand when using expressions is when to use back-quotes (`). The back-quote key is same key as the Tilde (~) key. It's usually found in the upper-left corner of the keyboard.
Placing something in backquotes tells TouchDesigner that the enclosed string is an expression that should be evaluated.
You need to place back-quotes around an expression if it's being used in a place where TouchDesigner is usually expecting a string. For example an expression in a string parameter like the Text TOP's Text parameter needs to be enclosed in back-quotes. However an expression in a numeric parameter like the Geometry object's Translate parameter does not need back-quotes, because TouchDesigner expects either a number, or an expression in that parameter.
You must always enclose expressions in scripts and when entering commands in the textport. E.g
echo sine of 45 degrees is `sin(45)`