Section 10: Instrument programming Model 2601B-PULSE System SourceMeter Instrument Reference Manual
10-20 2601B-PULSE-901-01A April 2020
String concatenation
Concatenates two strings. If either argument is a number, it is coerced to a string (in a
reasonable format) before concatenation.
Example: Concatenation
print(2 .. 3)
print("Hello " .. "World")
Operator precedence
Operator precedence in Lua follows the order below (from higher to lower priority):
• ^ (exponentiation)
• not, - (unary)
• *, /
• +, –
• .. (concatenation)
• <, >, <=, >=, ~=, ==
• and
• or
You can use parentheses to change the precedences in an expression. The concatenation ("..") and
exponentiation ("^") operators are right associative. All other binary operators are left associative. The
examples below show equivalent expressions.
reading + offset < testValue/2+0.5
(reading + offset) < ((testValue/2)+0.5)
Rdg < maxRdg and lastRdg <=
expectedRdg
(Rdg < maxRdg) and (lastRdg <=
expectedRdg)
reading^(testAdjustment^2)