Promotic
WikipediaLinkedInYoutubeTwitterFacebook

JavaScript

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.).

Although the PROMOTIC application 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.

- Boolean: This JavaScript object represents Boolean value.

But the PROMOTIC system uses the primitive data types instead.

- Date: This JavaScript object has many methods for working with date and time.

The PROMOTIC system stores date and time into 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 method Pm.CreatePmDateObject 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.

In contrast 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.

History:
Pm8.02.00: Created
PROMOTIC 9.0.4 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice