Support for Nothing and Optional Parameters JScript

NORMAL LEGAL DISCLAIMERS APPLY TO THIS SOFTWARE. DON'T TRY TO RUN NUCLEAR POWER PLANTS, LIFE-SUPPORT SYSTEMS, OR YOUR TOASTER WITH IT.

General Information

This component allows you to pass Nothing (aka NULL, aka an invalid reference to an ActiveX Object) as a parameter to other ActiveX objects in JScript. It also allows you to skip 'optional' arguments in function calls (methods).

The source code is freely available from me, Peter Torr. (If that address fails, try this one, but the first address will get a much quicker response).. It should be available on the web, hanging off the directory http://www.netspace.net.au/~torrboy/code/. The general sort of free-source rules apply - you can do what you want with this code, as long as:

  1. You don't intentionally use, or allow it to be used, for malicious purposes;
  2. You don't make a profit from selling the source code (you may, however, make a profit from the compiled code and / or from providing support);
  3. You give due credit myself, and anyone else who has contributed to the code.

Programming Information

This component is a standard ActiveX DLL, built with Microsoft's ActiveX Template Library (ATL) and Visual C++ 5. It has been marked as "Safe for scripting", but has not been signed.

Instantiation

ProgID
Torrboy.JArgUtility
CLSID
{BD2D8FF3-2F9A-11D3-BE76-00400533C717}
Interface
_JArgUtility
IID
{BD2D8FF2-2F9A-11D3-BE76-00400533C717}

Properties

Nothing
Returns Nothing. You can't do anything useful with the return value, except pass it to other methods that can handle references to Nothing.
OptionalArg
Returns something that can be used as an "optional" argument placeholder in a method call.

Example Usage

See the sample file "test.js" to see how to use this component.