Monday, October 10, 2005

[VBScript] Synthetic Includes in Traditional VBScript Files

Most of us are aware of the entry "Synthetic Includes in Traditional VBScript Files" in the Rube Goldberg Memorial Scripting Page.

Today I stumbled across how to embed test routines in the include file without causing these routines to be activated when the file is included.

My include file is called "StdFunctions.vbs". At the bottom of the file I've put
When StdFunctions.vbs is included by a script, ScriptFullName evaluates to the name of that script. It's only when StdFunctions.vbs is run by itself that ScriptFullName ends with "StdFunctions.vbs".

BaseName is one of my routines and look a bit like this:
[later that same day]

Read the manual, Bruce, read the manual: why use Basename with .ScriptFullName when you can just use .ScriptName?

No comments: