Programming Guide (JScript)



Yüklə 6,96 Mb.
Pdf görüntüsü
səhifə3/22
tarix07.11.2018
ölçüsü6,96 Mb.
#78683
1   2   3   4   5   6   7   8   9   ...   22

1.5 
 
Creating your first script  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  68
1.6 
 
Script debugging  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  73
1.6.1 
 
Script debugging features  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  73
1.6.2 
 
Creating and using test events
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  74
1.6.2.1 
 
Creating test events
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  74
1.6.2.2 
 
Running the script with a test event
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  76
1.6.3 
 
Using debugger windows of the Editor-Debugger utility  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  77
1.6.3.1 
 
Debugger window types: Script Messages and Thread Information  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  77
1.6.3.2 
 
Displaying messages about starting, verifying, changing and executing scripts in the debugger windows  . . .  78
1.6.4 
 
Using third-party debugger programs  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  80
1.7 
 
Examples of scripts in JScript language  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  81
2. 
 
Programming Guide (JScript). Conclusion  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  88
3. 
 
Appendix 1. Description of the Editor-Debugger utility
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  89
3.1 
 
The purpose of the Editor-Debugger utility  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  89
3.2 
 
The interface of the Editor-Debugger utility  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  89
3.2.1 
 
The Editor-Debugger window  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  89
3.2.2 
 
The Script Debug/Edit tab  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  90
3.2.2.1 
 
Description of the Script Debug/Edit tab
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  90
3.2.2.2 
 
The Script object panel in the Script Debug/Edit tab  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  91
3.2.3 
 
The Script Messages tab  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  92
3.2.3.1 
 
Description of the Script Messages tab  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  92
3.2.3.2 
 
The Script object panel in the Script Messages tab  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  93
3.2.4 
 
Main menu  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  94
3.2.5 
 
The Filter dialog window  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  98
3.2.6 
 
The Color dialog window  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  99
3.2.7 
 
The toolbar of the Editor-Debugger utility  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  100
4. 
 
Appendix 2. Creating virtual objects with ability to set events, reactions and states  . . . . . . . . . . . . . . . . . . . . . . . . . . .  103
4.1 
 
Purpose of virtual objects and their implementation in Intellect  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  103
4.2 
 
How to create a virtual object  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  103
4.2.1 
 
dbi file preparation  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  103
4.2.2 
 
ddi file preparation  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  104
4.2.3 
 
XML file preparation  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  108
4.2.4 
 
Creating and using a virtual object in Intellect  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  109


5
1.  
2.  
3.  
4.  
Programming in JScript
JScript functionality in Intellect
The JScript programming language is used in Intellect to implement additional user functions not included in the basic Intellect functionality.
JScript is a de-facto standard for developing and running user scripts. Intellect supports the version of JScript based on ActiveX technology by Microsoft. The general description of the 
JScript object model is given in the Microsoft documentation (for example, MSDN).
The JScript scripts in Intellect are executed using the standard ActiveX modules included in the Windows operating system. So, any objects from the ActiveX-based JScript can be used 
in developing the scripts for Intellect.
A set of specialized JScript objects is provided in Intellect for handling Intellect system objects, and for sending and receiving system events and actions.
Description of the JScript object model in Intellect
The Core object and its built-in methods
The Core object
The 
 object is a global static object providing the methods for monitoring and controlling the Intellect system objects.
 methods allow receiving information about the existing 
Core
 Core
objects, generating reactions for them and changing their states. 
 methods can pause script execution, script debugging, creating and calling global variables.
Core
The
 object is not a prototype, thus no other objects can be created on its base (it cannot be used as a template). All 
 methods are static. Thus, 
 methods are called 
 Core
Core
Core
directly from the script with no need for a 
 prefix.
Core
The SetObjectParam method
The SetObjectParam method sets the values of object parameters.
Method call syntax
function  SetObjectParam(objtype: String,  id: String,  param : String, value : String)
Method arguments:
objtype - required argument. The type of the object whose parameters are to be set. It takes the following values:  Type – String, range – existing object types.
id - required argument. Identification number of the object of the type set in the objtype parameter. It takes the following values:  Type – String, range – existing object 
identification numbers of the specified type.
param - required argument. The parameter of the object. It takes the following values:  Type – String, range – available parameters of the object.
value - required argument. The value to be set for the parameter specified in the param argument. It takes the following values:  Type – String, range – depends on the 
parameter.
Usage examples


Yüklə 6,96 Mb.

Dostları ilə paylaş:
1   2   3   4   5   6   7   8   9   ...   22




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə