Precedence - Keithley 2601 Reference Manual

System sourcemeter 2600 series (smu)
Hide thumbs Also See for 2601:
Table of Contents

Advertisement

Section 2: TSP Programming
circle = {clr = "red", diam = 1, setdiam = function(d)
print(circle["clr"])
print(circle["diam"])
circle["setdiam"](2)
print(circle.diam)
circle.setdiam(3)
print(circle.diam)
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 equivalent 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
and nil as false and anything else as true.
false
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)
2-48
circle["diam"]=d end}
-- Index using a string; print the clr property.
-- Index using a string; print the diam property.
-- Change the diam element by calling setdiam method.
-- circle["diam"] is the same as circle.diam; simpler syntax
-- Change the diameter of the circle again.
-- Print diam property again using simple syntax.
- (unary)
/
-
>
<=
>=
(a+i) < ((b/2)+1)
5+((x^2)*8)
(a < y) and (y <= z)
-(x^2)
x^(y^z)
Return to
Series 2600 System SourceMeter® Instruments Reference Manual
~=
==
Section Topics
2600S-901-01 Rev. C / January 2008

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

26362602261126122635

Table of Contents