The "Optional Parameter" is a hang-over from the way a couple
of dudes implemented their macro-assembler on a PDP mini-computer
decades ago. It is indeed a nifty feature, even if it did
fall out of a historical accident, but it is incompatible with
most current ideas about computer language design (Pearl excepted:
the designer of Perl is strongly supportive of irregular forms
for common verbs like DoCmd.OpenForm).
Ironic isn't it, that VB got optional parameters by aping C,
but C++ and OLE don't really have optional parameters any more?
In Access, optional parameters should default to Null, not
Missing (think about it!), but the fact is that Null is not
and cannot be a defined concept: we often wish Null to map
to 0 and "" and Empty and Error and Missing, and we often
wish Null to /NOT/ map to 0 or "" or Empty or Error or Missing:
there is no universal answer to some questions.
(david)
"(Pete Cresswell)" <x@y.z> wrote in message
news:td********************************@4ax.com...
I've dabbled in "Optional" over the last few days and think I'm coming
down against using it.
Seems to me like it makes the code harder to read and more complicated.
Instead of using Optional, I'm making the parm a Variant and passing Null
when it's not used.... then checking for "If Len(theParmValue & "") > 0... to
see if it is present.
That way I can eliminate checks for IsMissing(theParmValue)...
Anybody else have thoughts on this?
--
PeteCresswell