User manual

Series 3700 System Switch/Multimeter Reference Manual Section 2: TSP Programming Fundamentals
3700S-901-01 Rev. C / July 2008 2-35
Relational operators:
< (less than)
> (greater than)
<= (less than or equal)
>= (greater than or equal)
~= (not equal)
== (equal)
Logical operators:
and
or
not
Functions
TSL allows you to define functions which can take a pre-defined number of
parameters and return multiple parameters. Functions are first-class values in
TSL, which means that they can be stored in variables, passed as arguments,
and returned as results if desired.
This is a function called "add_two":
function add_two(parameter1, parameter2)
return(parameter1 + parameter2)
end
print(add_two(3, 4))
This is an alternate syntax for defining a function, called "add_three":
add_three = function(parameter1, parameter2, parameter3)
return(parameter1 + parameter2 + parameter3)
end
print(add_three(3, 4, 5))