Re: Need help in Optional keyword
Mark Burns <[email protected]> Mon, 22 Jul 2002 11:58:38 -0400
| Newsgroups | gmane.comp.windows.devel.vbcom |
|---|---|
| Message-ID | <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAM4zfucMf7ki18ZSBD7ZyeGKEAAAQAAAAxHFGHnXc1UGw4WmDaHWLywEAAAAA@quixnet.net> |
Jesse, I gotta go with Andrew with this one. Using variant optional parameters and ismissing() is the only way to ascertain whether the parameter was passed in or not. With your suggested method how would you ever be able to tell whether or not the vbNullString value was actually supplied in the method/function/sub call or not? No how/no way to do it. Now as to how to reconcile the desire to be able to use ismissing with the strong desire to avoid use variants... It's one 'o those irresistable force/immovable object conundrums. Regards, - Mark > -----Original Message----- > From: Technical discussion of VBCOM > [mailto:[email protected]] On Behalf Of Jesse Sanders > Sent: Monday, July 22, 2002 10:28 AM > To: [email protected] > Subject: Re: [VBCOM] Need help in Optional keyword > > > Set default values for your optional parameters and check to > see if they are > still set to the default.... > > i.e., byval optional strConnString as string = vbnullstring > > if strConnString = vbNullString then > '-- No conn string was passed in > else > '- Do whatever > end if > > HTH, > > Jesse > > > > >From: "P. S. Manikandan" <[email protected]> > >Reply-To: Technical discussion of VBCOM <[email protected]> > >To: [email protected] > >Subject: [VBCOM] Need help in Optional keyword > >Date: Fri, 19 Jul 2002 01:16:35 -0700 > > > >Hi... > > I have one function with three parameters. First one is > >mandatory , second and third parameters are optional. Now i > want to find > >out whether value is passed for the optional parameters or > not...how can i > >do this...any suggestions.. > > > >Regards > >Manikandan > > > >You can read messages from the VBCOM archive, unsubscribe > from VBCOM, or > >subscribe to other DevelopMentor lists at http://discuss.develop.com. > > > _________________________________________________________________ > Send and receive Hotmail on your mobile device: http://mobile.msn.com > > You can read messages from the VBCOM archive, unsubscribe > from VBCOM, or > subscribe to other DevelopMentor lists at http://discuss.develop.com. > > You can read messages from the VBCOM archive, unsubscribe from VBCOM, or subscribe to other DevelopMentor lists at http://discuss.develop.com.