Search code examples
vbscript

Is there ways to create optional arguments to functions in vb script?


Is there ways to create optional arguments to functions in vb script allowing you to write functions something like...

myFunc("happy")
myFunc("happy", 1, 2, 3)
myFunc("happy", 1)
etc.

Solution

  • The optional keyword (like in VB6) is not allowed in vbscript

    maybe this helps: https://web.archive.org/web/20210304114036/http://www.4guysfromrolla.com/webtech/071801-1.shtml