Keithley 708B Reference Manual page 214

Switching matrix
Hide thumbs Also See for 708B:
Table of Contents

Advertisement

Models 707B and 708B Switching Matrix Reference Manual
String concatenation
String operators
Operator
..
Example: Concatenation
Code
print(2 .. 3)
print("Hello " .. "World")
Operator precedence
Operator precedence in Lua follows the order below (from higher to lower priority):
Precedence
Highest
.
.
.
.
.
.
Lowest
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.
Equivalent expressions
reading + offset < testValue/2+0.5
3+reading^2*4
Rdg < maxRdg and lastRdg <=
expectedRdg
-reading^2
reading^testAdjustment^2
707B-901-01 Rev. A / August 2010
Description
Concatenates two strings. If both operands are strings or number, they are
converted to strings according to Lua coercion rules, as follows:
Any arithmetic operation applied to a string tries to convert that string to
a number, following the usual rules.
Whenever a number is used where a string is expected, the number is
converted to a string, in a reasonable format.
Operator
^ (exponentiation)
not, - (unary)
*, /
+, -
.. (concatenation)
<, >, <=, >=, ~=, ==
and
or
Section 6: Instrument programming
Output
23
Hello World
=
(reading + offset) <
((testValue/2)+0.5)
=
3+((reading^2)*4)
=
(Rdg < maxRdg) and (lastRdg <=
expectedRdg)
=
-(reading^2)
=
reading^(testAdjustment^2)
6-23

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

707b

Table of Contents