Ole4D Methods

OCCreaScriptHost(p_ScriptHost)


Creates a VBS interpretor that can be later used to execute VBScript code.
A script host is identified by it's name. You can use any string for name except the empty string.
If a script host with the same name already exists then it will be first destroyed and a new script host will be created.
Each script host created with this command will contain the SHost object, which is automatically created by the plug-in.

Parameters
Parameter Type   Description
p_ScriptHost String -> Script host name. This may not be the empty string.


Return Values
0 -if no error
Other return values different of 0 represent the system error code of the error that occurred.

Remarks
Script hosts can be used totally independent of any ole object. You do not have to create an Ole4D area to run a script.


Following method call sequence:
$i:=OCCreaScriptHost(“test”)
$i:=OCCreaScriptHost(“test”)

is equivalent to:
$i:=OCCreaScriptHost(“test”)
$i:=OCDestroyScriptHost(“test”)
$i:=OCCreaScriptHost(“test”)


Example
$i:=OCCreaScript(“test”)
$i:=OCRunScript(“test”,”MsgBox ”+Char(34)+”HELLO”+Char(34)+” “)
$i:=OCDestroyScriptHost(“test”)


See Also
OCDeclareObj, OCRunScript, OCRunScriptA, OCDestroyScriptHost