EasyManua.ls Logo

Topcon OPUS A6G2 - Page 525

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...
525
OPUS Projektor Manual
JavaScript
//This is a comment
Comments can also be spread over several lines:
/*
This
is
a
multiline
comment*/
Note that every command in a JavaScript should end with a semicolon ";".
JavaScript Variables
JavaScript is a weakly typed scripting language which means that no type declaration is
needed when creating variables and differently typed variables can be assigned to each
other.
//To create a variable use the keywork "var":
//Creates an integer variable with value 1
var numberVariable = 1;
//Creates a string variable with value "myString"
var stringVariable = "myString";
// Creates an array with the size of 4
var myArray = new Array(4);
Please note that the initialization "var variablename" leads to the deletion of the variable after
the script was processed. For JavaScript variables to be used globally, they need to be
initialized without the keyword var. It is preferred to use PClient variables to store important
data. JavaScript variables should not be used for that.
Operators
The following operators can be used for coding:
Opera
tor
Example
Result
Comment
+
12 + 30
"Java" +
"Script"
42
"Java
Script
"
-
69 - 27
42
*
16 * 3
42
/
126 / 3
42
%
3 % 2
4 % 2
1
0
Modulo operator
++
i = 41;
i++, ++i
42
increment
--
i = 43;
i--, --i
42
decrement
==
==
==
3 == 2
42 == "42"
42 == 43
false
true
true
weak compare

Table of Contents