EasyManua.ls Logo

Topcon OPUS A6G2 - Page 526

Topcon OPUS A6G2
800 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
526
OPUS Projektor Manual
JavaScript
Opera
tor
Example
Result
Comment
===
===
42 === 42
42 === "42"
true
false
strong compare
<
42 < 43
"w" < "W"
true
false
less than
<=
42 <= 42
42 <= 43
true
true
less or equal
>
42 > 43
false
greater than
>=
42 >= 43
false
greater or equal
=
i = 42
Value 42 is assigned to
variable i
+=
i += 1
43
i = i + 1;
-=
i -= 1
42
i = i - 1;
*=
i *= 2
84
i = i * 2;
/=
i /= 2
42
i = i / 2;
%=
i %= 2
0
i = i % 2;
i = 2; j = 5;
&&
(i <= 2) &&
(j < 7)
true
both statements need to be
true (AND)
||
(i%2 == 0) ||
(j%2 == 0)
true
only one statement need to
be true (OR)
!
(i ==2) && !
(j%2 == 0)
true
negation of a statement
(NOT)
i = 2; j = 7;
&
i & j
2
Check if bit is set. In binary:
0010 & 0111 = 0010
|
i | j
7
Set a bit. In binary: 0010 |
0111 = 0111
^
i ^ j
5
Toggle a bit. In binary: 0010
& 0111 = 0101
<<
2 << 1
4
Shift bits to the left. In binary:
0010 << 1 = 0100
>>
2 >> 1
1
Shift bits to the right. In
binary: 0010 >> 1 = 0001
>>>
i = 10;
i >>> 2
2
Shift right and fill with zeros.
In binary: 1010 >>> 2 = 0010
Loops
Loops can be used in JavaScript similar to many other programming languages.
WARNING: A loop stops execution of the main application until it is finished. So make sure
that only very short loops are used.
WARNING: Loops should and can NOT be used to "wait" within a JavaScript program. You
can NOT "spend time" within one JavaScript. If you need to time something, use the repeated

Table of Contents