Bonjour Andrew Douglas Pitonyak
Message du 2006-01-02 16:30:
Andrew Jensen wrote:
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:
(...)
Then isMissing returned the correct response in all cases. So is this
because of the Boolean types as optional parameters?
(Note that this subject concerns udk, not API mailing list)
The bug is not in the order or the type of optional parameters, but in
the order of testing the optional parameters. If you test the optional
parameters in the same order as they appear in the definition, IsMissing
is working OK. If you test in a different order, result is nonsense.
Example, call the above routine without any optional argument.
Put this in the routine, it will work OK:
if IsMissing(isCaseSensitive) then MsgBox("isCaseSensitive is missing")
if IsMissing(UserName) then MsgBox("UserName is missing")
But this code instead will give a wrong answer:
if IsMissing(UserName) then MsgBox("UserName is missing")
if IsMissing(isCaseSensitive) then MsgBox("isCaseSensitive is missing")
The bug was reported in IZ 30500. In versions 1.1.x and 2.0.1 it is
still not corrected and not even documented, so it should not have
status RESOLVED and FIXED.
Bernard
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]