Andrew Jensen wrote:

Question,

I attempted to write a function with the following declaration:

function findCodeVal( RegDSName as String, _
                      TableName as String, _
                      SrchColName as String, _
                      SrchFor as variant, _
                      RetColName as String, _
                      optional isCaseSensitive as boolean, _
                      optional isFuzzy as boolean, _
                      optional aConn as variant, _
                      optional UserName as String, _
                      optional Password as String) _
                      as variant

However, with this declaration, isMissing returns False for every optional parameter, even when none have been pass in to functions call.

When I changed the order of the parameters to:

function findCodeVal( RegDSName as String, _
                      TableName as String, _
                      SrchColName as String, _
                      SrchFor as variant, _
                      RetColName as String, _
                      optional UserName as String, _
                      optional Password as String, _
                      optional isCaseSensitive as boolean, _
                      optional isFuzzy as boolean, _
                      optional aConn as variant) _
                      as variant

Then isMissing returned the correct response in all cases. So is this because of the Boolean types as optional parameters?

If so, can any one tell me what other rules apply to order of optional parameters.

Thanks in advance.

Andrew 'Drew' Jensen

(Apologies if this is a second posting, I sent this yesterday but it does not seem to have made it for some reason)

As of version 1.0.3.1, IsMissing will fail with Optional parameters if the type is not Variant and the missing optional parameter is represented by two consecutive commas. I first investigated this behavior after speaking with Christian Anderson [EMAIL PROTECTED] This is issue 11678 in issuezilla. The issue was closed with a note that it needed to be created under a different topic, which I know because I just went back and checked the status. This may be related.... Then again, I have not verified that the original issue is still a problem.

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to