Can a Handler Differentiate Between Empty & Missing Parameters?
kray at sonsothunder.com
Thu Mar 9 14:20:22 CST 2006
On 3/9/06 2:05 PM, "Rob Cozens" <rcozens at pon.net> wrote:
> Hi All,
> Given a handler such as:
> on myHandler requiredParam, at optionalParam
> can myHandler differentiate between
> put empty into optionalParam
> myHandler requiredParam,optionalParam
> myHandler requiredParam,
Well, first of all you can't call a handler like:
because the trailing "," causes an error when trying to close the script.
If you provide *no* second param:
Then you get an error trying to *execute* the command because
pass-by-reference parameters can't be optional.
And if you provide empty as the second param:
You *also* get an error because the second param is not a variable, and so
it won't work with pass-by-reference parameters.
So the original question is moot...
Of course you might want to vote for Bug #741, as I suggested optional PBR
variables as an enhancement to Rev...
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com
More information about the use-livecode