18.01.2013 Views

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>VBScript</strong> <strong>Reference</strong> <strong>Manual</strong> <strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong><br />

Access of an object’s methods, properties and fields are made by referring to the object,<br />

followed by a period, then the particular method, property or field of interest. E.g.<br />

Object.Method<br />

Object.Property<br />

Object.Property.Item<br />

• Dynamism<br />

Dynamism relates to the method of allocating computer resources and definition resources<br />

required to run an object-oriented program. There are different types, but <strong>VBScript</strong> used latebound<br />

(late-binding) dynamic typing. This means that the <strong>VBScript</strong> engine will make the object<br />

type determination at runtime and allocate sufficient memory at that time. Note that <strong>VBScript</strong><br />

and VB.NET are slightly different in their approach to dynamism, and there<strong>for</strong>e they can declare<br />

some variables and objects in different manners (although many <strong>for</strong>ms of declaration are the<br />

same).<br />

• Outlet Connections<br />

At times, Objects will connect together and this connection needs to be defined. With IWS, an<br />

example of a connection would be between a <strong>VBScript</strong> object (e.g. ADODB) and a Database<br />

Provider (a Provider is a front-end to a database). This connection needs to be defined, and<br />

then the connection string (of parameters) between the objects gets defined. When the need <strong>for</strong><br />

the connection is finished, the connection should be closed.<br />

While a full treatment of object-oriented programming is beyond the scope of these materials, the<br />

fundamental concepts of Objects and Classes are important to understand. <strong>VBScript</strong> supports COMbased<br />

Objects (Component Object Module, a Microsoft standard) such as the ActiveX controls,<br />

ADO.NET, FileSystemObject, and Microsoft Office Automation objects. <strong>VBScript</strong> also supports userdefined<br />

classes, or Class Objects.<br />

<strong>VBScript</strong> COM objects and <strong>VBScript</strong> Class objects differ from each other in several important respects.<br />

These differences lead to each type of object having its unique strengths:<br />

• <strong>VBScript</strong> classes are more flexible than <strong>VBScript</strong> COM objects. Class Objects have an abstract<br />

subtype that encapsulates the data you want and the functions you need to work with that data.<br />

<strong>VBScript</strong> COM objects have only basic subtypes (integer or string).<br />

• <strong>VBScript</strong> classes are slightly more efficient than COM objects. The <strong>VBScript</strong> parser can execute<br />

the classes' code directly instead of asking the COM object to execute a method.<br />

• COM objects are binary modules. <strong>VBScript</strong> classes are ASCII files.<br />

• You can use any scripting language to write COM objects. You can only use <strong>VBScript</strong> to write<br />

<strong>VBScript</strong> classes.<br />

• You can use COM objects from within any development environment that supports COM<br />

automation. <strong>VBScript</strong> classes can only be used within development and runtime environments<br />

that support <strong>VBScript</strong> (e.g IWS and Microsoft Internet Explorer).<br />

22 <strong>InduSoft</strong>, Ltd.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!