JavaScript is an object oriented scripting programming language. Its syntax belongs to the C/C++/Java famiy. However there is no connection with the Java language (except for the similar syntax).

JavaScript is a high level language that supports many constructions valued by programmers (a set of own functions and methods, dynamic objects, first-class functions, prototyping, regular expressions, inheritance etc.).
The designer is not forced to use these higher functions (it is even not recommended to use them) because only the basic knowledge of the language syntax is needed for application design (see JavaScript statements, The JavaScript operators, Data types JavaScript).
This way the language becomes very simple to use, even simpler than the VBScript language - see Comparison of the VBScript and JavaScript languages.

The PROMOTIC system does not even use the embedded objects of the JavaScript language and replaces them by its own objects.
The JavaScript objects are listed below:
- String: This JavaScript object has many methods for working with text strings.
But the PROMOTIC system uses the String data type, which is a primitive data type, not an object.
For working with this type the Pm string methods can, for example, be used.
- Number: This JavaScript object represents all numeric values (Byte, Integer, Long, Single, Double).
But the PROMOTIC system uses the primitive data types instead of this object.
- Boolean: This JavaScript object represents the Boolean value.
But the PROMOTIC system uses the primitive data types instead of this object.
- Date: This JavaScript object has many methods for working with date and time.
The internal value of this object is of the Double type and it is represented by a number of milliseconds since 1.1.1970 - this value can be obtained by the JavaScript method Date.getTime().
The PROMOTIC system stores date and time to the value of the Double type (it is a number of days since 30.12.1899 - the same way as Date data type of the VBScript language).
The values can be converted between JavaScript and PROMOTIC (of the Double type) by the Pm.GetDateOf(1, tDate, 0, 4).
The Pm.CreatePmDateObject method can be used to transform the values of the Double type into a PmDateObject object. This object has its own methods for working with date and time (read and write hour, day, month, etc.).
See also: Pm date and time methods.
- Array: This JavaScript object represents 1-dimensional array.
The PROMOTIC system uses the Array data type instead, that corresponds to the JavaScript language PmArray object.
Contrary to the JavaScript object, the PmArray object can be 1-dimensional or 2-dimensional and all the features of this object are adapted to the needs of the PROMOTIC system.
See also: How to use array of values in the PROMOTIC system.
- Math: This JavaScript object represents a library of mthematic methods.
The PROMOTIC system has its own mathematic methods, see Pm properties and methods mathematic and others.
- Object: This JavaScript object represents the basic object. The PROMOTIC system does not need such object.
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.