Expressions with plain text?


#1

Would like to know whether it’s possible to include plain text in an expression and how to do so then whether it’s better to do it with an expression or as a value. Something such as setting piston state and using average of temperature sensors so that it’s say “Average temperature is [temp1:temperature]+[temp2:temperature]/2”

I’m sure that’s wrong but help would be appreciated - variables and especially expressions have never been my strong point.


#2

You can, enclose the text part of the expression in quotes. Something like:

"The average temperature is :" ([temp1:temperature] + [temp2:temperature])/2


#3

Whoa I was so close to getting it right - damn! Forgot the parentheses! Just to be clear - there’s spaces before and after the plus sign?


#4

Those spaces are ignored… works with or without.


#5

I just put the parenthesis in to make sure the order of calculation doesn’t get screwed up and yes, the spaces are not required like @Robin said, just makes for easy reading.