PDA

Click to See Complete Forum and Search --> : Default values for functions ...


MicahCarrick
Jan 17th, 2000, 10:58 AM
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.

Clunietp
Jan 17th, 2000, 11:01 AM
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

MicahCarrick
Jan 17th, 2000, 11:04 AM
Thank you ... and so fast too. :)

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