Search code examples
vbaprogramming-languagesqtpwsh

VB: What is missing in scripting host while it is present in "full" VB?


When programming (scripting) in VB scripting host, how can I learn what is implemented and what not?

For example, records (or: the structure keyword) are not implemented, but classes (or: the class keyword) isn't.

Dim as <Type> is not allowed, as are all "as" phrases.

You can create properties in classes, but not "as" anything, too.

You cannot inherit from a base class (the "Inherits" keyword is not known).

And so on.

I see the scripting host is a scripting host, so it might make sense to keep its functionality limited.

However, I do not see those limitations documented somewhere in an accessible, or even logcial way, giving all that a meaning. Currently, I am forced to stick to a trial-and-error workflow, plus separate lookups in QTPs online help for every detail I think of (and I might discover others which I forget currently). Is this the reality that Microsoft designed, or am i missing the point?

The question comes up with QTP, which uses Windows scripting host as its scripting language. Sure I can look up each and every detail I am looking for -- but, and these are my main questions:

Where can I find a detailed list, or table, of language differences between the various VBA dialects (and versions?) that covers scripting host as well?

Can one give a (simple) reasoning for what is included in scripting host and what not?


Solution

  • VBScript Language Reference on MSDN covers all statements, keywords, functions and other language elements of VBScript. I always refer to it to recollect the exact syntax.

    MSDN also has feature comparison guides for VBScript vs. VBA vs. Visual Basic: