Global Scripts

enaio® 10.0 »

Global scripts are used to provide constants, subprograms, and functions. It is possible to set up both a global client script and a global server script.

Before execution, data of the global client script will always be added to the scripts of client events, whereas data of the global server script will always be added to the script of server events.

A global object type script can also be created for each cabinet. Data that are only used for this object type in the cabinet are stored there. You can set up object type scripts using the context menu of an object type in the 'Object search' area.

You can create corresponding global webclient scripts and global webclient object type scripts for enaio® webclient.

Maintenance and administration of script code is significantly simplified due to this organization.

It is technically possible to add functions via Execute or ExecuteGlobal in scripts, but it is not recommended in production systems for security and performance reasons. In addition, it hinders troubleshooting substantially.
Support can be restricted for scripts with Execute or ExecuteGlobal.

Select the Common events item in the object search and click the Add event item in the context menu.

Select the desired script type and confirm with OK.

The editor window will open. The script can be edited.

The executable script code, which may be contained in a global script, will be carried out at every corresponding event. A pending job will not be executed if the result of an executed script code is 'false'.

Example of event script code related to a GlobalClientScript:

MsgBox TextForString
useGlobalScript
 
Sub useGlobalScript
  Dim ret
  call globalHello
  ret = Dummy("String aus aufrufender Funktion")
  MsgBox ret 
End Sub