Script debugging

To debug a script, use the Script editor which can be opened as follows:

The only requirement to start debugging a script is the following:

  • for objects of Event type - the D2000 Event Handler process (the parent of the corresponding object of Event type) must be running
  • for active pictures - the D2000 HI process must be running with the corresponding picture opened in it

After switching the script to the debug mode it is necessary to wait for suspending the execution of script actions. Then you can monitor:

The toolbar of the Script editor contains the following buttons used to debug a script:

ButtonDescription


Start

event - Starts the event instance and stops before the first action is executed
active picture - disabled for active pictures


Stop

Stops the script debugging. If the debugging has been started by clicking the  button (Start), clicking the button stops the script execution and a forced termination log will be written into the log database. If the debugging has been started by clicking the  button  (Attach to the running script), the given instance keeps the execution of script actions.


Wait for
Launch

Command waits until the script is running and the script debug conditions are met. Once the conditions are met, the script is to be switched to the debug mode and its execution stops at the first action.
The script debugging conditions are specified in the following dialog box:



The script is switched to the debugging mode after the given number of starts is reached. The number includes either all script (regardless of instance - the parameter Only for instance is not enabled) or just the script of defined instance (the parameter Only for instance enabled and an instance number specified).

 For a selection of the specific D2000 Event or D2000 process intended for ESL script debugging push the SHIFT button and click on the option (button):
   - Wait for Launch
   - Attach to running script

The window used for process selection for debugging opens after this.



As regards the Server event, which has been started in *.HIP process by OPENEVENT script action, you should define on which side it has been started (LOCAL - script started on the client side - HI, REMOTE - script started on the server-side - SEE).

Note: Physical instance for objects of Event type and logical instance for active pictures.


Attach to running
script
 

The Script editor is attempting to switch the script to debug mode. If successful, then the script execution is either suspended or the Script editor is waiting until the first event is executed in order to suspend the execution. The next progress of the Script editor is regular. If the script is opened several times (various instances) within the respective process, the Script editor automatically displays their list.



InstanceLogical instance number - the instance number the object has been open with.
Instance number can be retrieved by the %HI_GetSelfInstanceId (for active pictures only) or %GetSelfInstanceId functions.
InfoNot implemented yet.
HOBJObject instance HOBJ.
Instance number can be retrieved by the %GetSelfHBJ function.
D2000 Server instancePhysical instance number of the object in D2000 system - used by the process D2000 Server.
Physical instance number can be retrieved by the %HI_GetSelfInstanceId (for active picture only) or %GetSelfInstanceId functions.
Internal instanceInstance number used by the script interpreter - an internal unique identifier.
Its values can be retrieved by the %GetEventInstanceId function.
UserThe user under which the instance is running
User descriptionDescription of the user under which the instance is running

Note: The functions listed in the HOBJ and D2000 Server instance rows require for their functionality the name of the script interpreter to be specified (i.e. D2000 Event Handler for an object of Event type or D2000 HI for active picture).

Napíšte komentár