Keithley SourceMeter 2600 Series Reference Manual page 109

Table of Contents

Advertisement

Series 2600 System SourceMeters Reference Manual TSP Programming Fundamentals 2-57
Output of code above:
red
1
2
3
Precedence
Operator precedence in TSL follows the table below, from higher to lower priority:
^
not
*
+
.. (concatenation)
<
and
or
All operators are left associative, except for ' ^ ' (exponentiation) and ' .. ', which
are right associative. Therefore, the following expressions on the left are equiva-
lent to those on the right:
a+i < b/2+1
5+x^2*8
a < y and y <= z
-x^2
x^y^z
Logical operators
The logical operators are and , or , and not . Like control structures, all logical
operators consider false and nil as false and anything else as true.
The operator and returns its first argument if it is false, otherwise it returns its
second argument.
The operator or returns its first argument if it is not false; otherwise it returns its
second argument:
print(4 and 5)
print(nil and 13)
print(false and 13)
print(4 or 5)
print(false or 5)
Output of code above:
5
nil
false
- (unary)
/
-
>
<=
>=
(a+i) < ((b/2)+1)
5+((x^2)*8)
(a < y) and (y <= z)
-(x^2)
x^(y^z)
Return to
~=
==
Section 2 topics
2600S-901-01 Rev. A / May 2006

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents