Results 1 to 3 of 3

Thread: Default values for functions ...

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Location
    Californ-I- A
    Posts
    207

    Post

    I'm curious of two littlw things...

    a> How can I have one of the arguments in my
    function be an optional value (like the ones in VB that have the "[" and "]" around them in the tooltip.)

    b> If i don't prefix my arguments with ByRef or ByVal which one is used by default?

    Thanks y'all.

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Private Declare Sub MySub(MyParam1 as string, Optional OtherParam2 as string, Optional OtherDefaultParam3 as string = "Hello World!")

    First param is required, second is optional, third is optional, and provides a default value if not provided

    All parameters are passed ByRef by default

    Tom

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Location
    Californ-I- A
    Posts
    207

    Post

    Thank you ... and so fast too.

    ------------------
    Micah Carrick
    http://micah.carrick.com
    micah@carrick.com
    ICQ: 53480225


Posting Permissions

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



Click Here to Expand Forum to Full Width