newObjects-logo.gif (1024 bytes) ScriptAggregate reference
AddEngine method

Loads and initializes new empty script engine for the script language specified.

variable = object.AddEngine(script_engine_name)

variable boolean true if the operation was successful and false if not
object ScriptAggregate Previously created ScriptAggregate object
script_engine_name string Name of script engine - JScript, VBScript etc.

Remarks:

Method fails if a script engine for the specified language is already initialized. When initializing the object for the first time (after creation) you must first call this method before any calls to the script control methods. When reusing component method will return error if the previously loaded engine (and script) is not closed (see Close).

Only the languages added using this method are available for the AddTExt and AddTextEx methods. In other words you can add code written in the languages added to the aggregate.

All the languages will see their public parts as like they are one single script. Most of the scripting languages are entirely public, but some (as like VBScript) support specific mechanisms that allow the programmer to declare certain variables or routines as not accessible for the other engines - see the Private keyword in VBScript for example.

See also:

ScriptManager2's script property

C++ Helper SCPHOSTCLNT::LoadEngine method

newObjects Copyright newObjects 2001-2005