5

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?

TheBlastOne
  • 4,291
  • 3
  • 38
  • 72

1 Answers1

6

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:

Helen
  • 87,344
  • 17
  • 243
  • 314
  • BANG! Full hit, enemy doooown. Thanks. – TheBlastOne May 06 '11 at 08:38
  • Mhmmm...anybody knows why all of the documents Helen provided links to do not mention inheritance? – TheBlastOne May 06 '11 at 12:39
  • 1
    Because, sadly enough, inheritance isn't possible in VBScript/QTP. Even using a class outside a module/QFL is not directly possible. (There are solutions for that: You can create a public (global) variable and assign a class to it inside the module. This variable acts as a singleton. An even more elegant solution is creating a public function that returns an instance of the class; the function can act as a class instantiator, even with parameters.) – AutomatedChaos Jun 01 '11 at 06:51