VB Script Add-on

enaio® editor 10.10 »

The VB script add-on allows you to execute VB scripts, for example, edit field indexing using VB scripts.

VB scripts can be supplied by OPTIMAL SYSTEMS GmbH on request, or they can be created in VB Editor. The add-on must be licensed via the 'VBX' module, whereas VB Editor must be licensed via the 'VBE' module. For the VB editor, the user needs the system role 'enaio® editor: Start', which is assigned in enaio® administrator.

Select Add-on in the Catalog line of the properties window to create the Add-on tab.

Use the file selection dialog to select the axaddeur.dll file located in the enaio® editor installation directory and the administration components.

Enter the path to the script in the configuration field:

EXTRA00=e:\os\vbscripts\scriptbezeichnung.vbs

If the VB script add-on is assigned to an index data field, the field receives a catalog button. Press the left mouse button to run the linked script and the right mouse button to launch VB Editor.

If the add-on is placed on a form which is opened as read-only, it is only executed if you have specified CANLOCK=0 as the last entry in the configuration field.

VB Editor

In VB Editor scripts can be created or available scripts can be imported. Scripts which have not been provided by OPTIMAL SYSTEMS GmbH will need to be created or imported and saved in VB Editor. They are encrypted when they are saved and can only be executed by the add-on if they are encrypted. Scripts can be saved with a password and require additional licensing. Passwords may only contain ANSI characters.

VB Editor can be opened by right-clicking the catalog button that has been set up.

In the VB editor, the library oxactive.dll provides the variable 'oxhelp' and the constant 'OSFile', which enable access to index data fields. This significantly increases the options available for script control.

The constant 'OSFile' enables access to a handoff file.

The file has the following structure:

[DATA]
Objekt= name of the object ('cabinet') linked to the add-on.
Flags= various flags, which can be set in the editor.
Index= a DB index
Feld00 to FeldXX= names and field contents of the linked dialog boxes
EXTRA00 to EXTRAXX= extra entries from add-on definitions.

The variable 'oxhelp' makes the following functions available:

GetProfString(section, key, default return string, return string, file name)

This function corresponds to the Windows API function 'GetPrivateProfileString'.

Example:
dim b, a
set b = CreateObject("oxactive.COxHelp.1"')
b.GetProfString "Sektion", "Schlüssel", "", a, "d:\\temp\\test.cfg"

WriteProfString(section, key, value, file name))

This function corresponds to the Windows API function 'WritePrivateProfileString'.

WinExec(file, parameter))

With this feature you can run a Windows application.

ExtractString(string, field name, field value))

This feature is used to separate the field name and the field value from the handoff file for the add-on.

Example:
ExtractString("Hauptbaugruppe|Brandschutz", a, b)
Here, a = 'Hauptbaugruppe' and b = 'Brandschutz'

 

The following sample script reads values from the handoff file, displays the values, and enters them in the addressee field of the opened e-mail dialog:

oxhelp.GetProfString "DATA", "Objekt", "", objekt, OSFile
oxhelp.GetProfString "DATA", "feld00", "", feld0, OSFile
oxhelp.ExtractString feld0, feldname, feldwert
dim string
string = "OBJEKT: " + objekt + "  Feld: " + feldname + "  Feldinhalt: " + feldwert
MsgBox(string)
oxhelp.WinExec "mailto:" + feldwert, ""