default arguments in sub

Results 1 to 2 of 2

Thread: default arguments in sub

  1. #1
    Join Date
    Dec 1969

    Default default arguments in sub

    can a subroutine in vbscript or javascript have default arguments

  2. #2
    Join Date
    Dec 1969

    Default RE: default arguments in sub

    VBScript -- no<BR><BR>JavaScript -- yes<BR><BR>In JS, you can count the arguments and, if the number is less than you expect, automatically supply default(s) for the missing one(s).<BR><BR>In VBS, there is no practical way. (Some have proposed passing an array of arguments, with some elements of the array NULL, but I think that is more trouble--and slower--than it is worth.)<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts