Download Z-View User`s Manual

Transcript
Appendix B
Operators and Functions
Operators and functions provide a way to evaluate complex expressions. Z-View supports nested
expressions using parentheses and correct order of evaluation in arithmetic and boolean expressions.
You can use expressions to scale values, evaluate complex conditions and manipulate strings, as well as
perform a wide range of mathematical operations on real-time data.
The syntax for functions is simple: <function name>(<value list>), where the value list is made of
one or more values separated by commas. For example, add(1;1;40001,5) takes the value of
1;1;40001, adds 5 to it and returns the result. Values in functions can be address references, aliases,
constants and even other expressions.
Operators are likewise simple: <value 1><operator><value 2>. For example 1;1;40001+5 performs
the same thing as the example above. Again, you can use address references, aliases, constants or other
expressions as values.
Operators
Operators are special functions which operate on two values. The syntax for operators is different from
functions in that operators are placed between the two values, and not in front of them. Operators are
divided into two kinds: comparison operator and manipulation operators. Each operator also has a
regular function name.
Operator Function
Description
=
compEqual
Returns true if the two values are equal, or false otherwise.
<>
compDiff
Returns true if the two values are different, or false otherwise.
>
compGreater
Returns true if the left value is greater than the right, or false
otherwise.
<
compLess
Returns true if the left value is less than the right, or false
otherwise.
>=
compGreaterEqual
Returns true if the left value is greater than or equal to the
right, or false otherwise.
<=
compLessEqual
Returns true if the left value is less than or equal to the right, or
false otherwise.
+
add
Adds the two values and returns the result.
-
sub
Subtracts the right value from the left and returns the result.
*
mul
Multiplies the two values and returns the result.
/
div
Divides the left value by the right and returns the result.
%
mod
Divides the left value by the right and returns the remainder.
^
bit
Returns the value of the bit referenced by the right value in the
left value. For example, 1;1;40001^5 returns the value of the
fifth bit in 1;1;40001.
&
and
Returns the result of a logical AND operation.
93