Ekas Software Windows Script Host Control for Delphi Help
.Add script extention
Script extensions provided by script control
Add: creates new control of given type, adds item to TStrings or creates adn adds collection item TCollection. For example:

Dim Control

Control = Self.Controls("Panel2")

'//Control is now assigned to Panel2

'//(see description of "Controls" extension below)

'//Self is, for example, some application's form

'//added to script earlier using

'//TekWSHControl.RegisterClass method

Control.Add "MemoExmpl", "TMemo", True

'//Creates New TMemo instance with name "MemoExmpl"

'//and sets accordable script procedures as event handlers

'//for it if they present in script. The last parameter is

'//not required and it is implied "False" if missed

In the example above, Control is TWinControl descendant.

If Control is TCollection, Add does not require any parameters, and created collection item is returned as result (for example, ColItem=Collection.Add)

If Control is TStrings descendant, Add adds a string to its Items. Here may be 1 or 2 parameters. If 2 parameters then first is position of item to be inserted and second is string itself (but both of them must be represnted as strings in script). If 1 parameter then it is string to be added. For example:

ListBox.Items.Add CStr(1), "This line will be inserted at the first position of ListBox"

ListBox.Items.Add "This line will be inserted at the end of ListBox"


Ekas Software Windows Script Host Control for Delphi Help
Copyright (c)2002,2003 Ekas Software