Optional Parameters for VBScript

Results 1 to 3 of 3

Thread: Optional Parameters for VBScript

  1. #1
    Join Date
    Dec 1969

    Default Optional Parameters for VBScript

    Without using classes, is there a way of specifying parameters for a VBScript function as optional? In the function.<BR><BR>such that the function can be called with or without that parameter...<BR><BR>Function test (vOne, vTwo)<BR> ...<BR>end function<BR><BR>call test("hello", "goodbye")<BR>call test("hello")<BR><BR>would both work.<BR><BR>thanks<BR>-fatty

  2. #2
    Steve Cimino Guest

    Default RE: Optional Parameters for VBScript

    Sorta kinda...<BR><BR>Just pass NULL to vTwo. Then, check for it inside your function, so you don&#039;t get an error.<BR><BR>Hopefully ASP.NET will support function overloading.

  3. #3
    fatty Guest

    Default RE: Optional Parameters for VBScript

    yeah, thanks. The problem was actually updating about a hundred fifty function calls to include this new parameter.<BR><BR>we&#039;re just using a wrapper. thanks again though.

Posting Permissions

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