Default Parameter Values?

Results 1 to 3 of 3

Thread: Default Parameter Values?

  1. #1
    digitalCoffee Guest

    Default Default Parameter Values?

    I am working on a large multi-site shopping cart project, in asp w/ vbscript. My question is this: how in vbscript do I say that a particular parameter in one of my subroutines is not required? Specifically, I want to assign a default value to a parameter, and if the caller of that function does not pass anything in, the parameter is assumed to have the default value.<BR><BR>Any ideas?<BR><BR>Thanks.<BR><BR>digitalCoffee.

  2. #2
    Join Date
    Dec 1969

    Default Cannot do in VBS...

    Sorry.<BR><BR>Best you could do would be to call your function/sub thus:<BR><BR>&#060;%<BR>xyz = myFunction( "arg1", Null )<BR>%&#062;<BR><BR>and then write the function:<BR><BR>&#060;%<BR>Function myFunction( parm1, parm2 )<BR>&nbsp; &nbsp; If isNull( parm1 ) Then parm1 = "foo"<BR>&nbsp; &nbsp; If isNull( parm2 ) Then parm2 = "bar"<BR>...<BR>%&#062;<BR><BR>

  3. #3
    digitalCoffee Guest

    Default RE: Cannot do in VBS...

    Oh well. That&#039;s what I was worried about.<BR><BR>Thanks for the quick response.

Posting Permissions

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