11.07.2015 Views

VBScript Reference Manual for InduSoft Web Studio - ICP DAS

VBScript Reference Manual for InduSoft Web Studio - ICP DAS

VBScript Reference Manual for InduSoft Web Studio - ICP DAS

SHOW MORE
SHOW LESS
  • No tags were found...

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><strong>VBScript</strong> Hosting EnvironmentsWhile much of the material contained in the document covers the <strong>VBScript</strong> language and its use <strong>for</strong>IWS applications, it is important to understand conceptually how <strong>VBScript</strong> works in an IWS environment.If you browse the web <strong>for</strong> in<strong>for</strong>mation on <strong>VBScript</strong>, you will likely find a plethora of in<strong>for</strong>mation, butmany of the examples are <strong>for</strong> running <strong>VBScript</strong> with ASP using the Windows Scripting Host.<strong>VBScript</strong> was developed using a Microsoft technology called ActiveX scripting, which is a COM-basedspecification that allows the development of runtime engines <strong>for</strong> virtually any scripting language. Otherscripting languages include JScript. <strong>VBScript</strong> can create an instance, or instantiate, a COM object, andthus through <strong>VBScript</strong>, many system features can be controlled such as ActiveX Controls, theFIleSystemObject (providing access to the Windows file system), Microsoft Office Automation (COM),and ActiveX Database Objects (ADO).The <strong>VBScript</strong> Scripting Engine runs on a host, and there are several hosts that can run <strong>VBScript</strong> (orany ActiveX Scripting-compliant engines) including Windows Scripting Host and Microsoft InternetExplorer. <strong>VBScript</strong> can be used in conjunction with Windows Scripting Host (WSH) to automate systemadministration tasks. WSH is part of the Microsoft operating system and treats a <strong>VBScript</strong> applicationlike a powerful batch file. <strong>VBScript</strong> applications can also be found with <strong>Web</strong>-based shell views. Mostfrequently, <strong>VBScript</strong> is used with Active Server Pages (ASP) <strong>for</strong> Server-side web applications andMicrosoft Internet Explorer <strong>for</strong> Client-side web applications.Stating with Version 6.1, IWS is now a host <strong>for</strong> the <strong>VBScript</strong> Scripting Engine. When used inconjunction with IWS, IWS becomes the only host <strong>for</strong> the <strong>VBScript</strong> Scripting Engine that is used. WSHis not used by IWS, even though WSH may be resident on the PC running the IWS application.<strong>InduSoft</strong> has placed implemented <strong>VBScript</strong> host environment in a manner that is logically consistentwith the current IWS application development environment and licensing method. What this means isthat there are multiple locations in the development environment where <strong>VBScript</strong> code segments canbe located (so the code is located close to its use), and restrictions placed on the scope of proceduresand variables. In IWS, there is no such thing as a Global Variable that is accessible by any <strong>VBScript</strong>code segment. The IWS tags and built-in procedures can be accessed by any <strong>VBScript</strong> code segment.The restrictions and interaction with IWS tags and built-in functions implemented by the IWS <strong>VBScript</strong>Host are covered in more detail in the VB Configuration and Operation in IWS section.The <strong>VBScript</strong> Scripting Engine per<strong>for</strong>ms a few key functions. It per<strong>for</strong>ms syntax checking in thedevelopment environment (e.g. right mouse click on a <strong>VBScript</strong> Interface, then select Check Script). Italso interacts with IntelliSense, an auto-completion tool that provides reference to available functions(<strong>VBScript</strong> and IWS), IWS tags and ActiveX Controls (name, Properties and Methods). And mostimportantly, it executes the <strong>VBScript</strong> code at runtime, providing error messages if an error occurs. Itshould be noted that unlike most programming languages, <strong>VBScript</strong> is not compiled; it runs in aninterpreted mode. The <strong>VBScript</strong> Scripting Engine (vbscript.dll) is responsible <strong>for</strong> interpreting (via the<strong>VBScript</strong> Parser, a part of the <strong>VBScript</strong> Scripting Engine) and executing the <strong>VBScript</strong> statements, and itdoes so quite efficiently. IWS uses Version 5.6 or later of the Microsoft <strong>VBScript</strong> Scripting Engine.There are no limitations on the number of <strong>VBScript</strong> variables supported in IWS, however the amount ofstorage <strong>for</strong> <strong>VBScript</strong> variables is determined by the amount of memory available in your system.<strong>VBScript</strong> variables do not count against IWS tag limits <strong>for</strong> licensing purposes.10 <strong>InduSoft</strong>, Ltd.

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

Saved successfully!

Ooh no, something went wrong!