>If you stick with the proper way to test if the argument was passed,
you'll get the expected behavior:
Sure. I think your missing the main thrust of my point.
Whether or not one can work around it, the point is that it's at odds
with the rest of CF (and logic) that <cfargument> can create an
uninitialised variable, without it being asked (it has a mechanism to
create defaults, remember).
>Besides, if you use:
>isDefined("arguments[1]")
>you'll also see that it is undefined.
Haha. Have you *tried* that?
Have you got *any* native way of evaulating whether an array element is
null, without try/catching the test? (Serious question... I've had to
resort to leveraging the underlying Java array methods, and I'd rather
not do that).
> <cfargument> is for defining what an argument might be. IF it's
> passed.
> And if you *want* to give it a default, the mechanism is there. CF
> should not be setting a default automatically.
>It isn't. NULL is a non-value - CF is not setting a value. A variable
with a NULL value is treated as undefined by CF. See also my response
to Ben...
Sorry, yes. My bad wording. "It should not even be creating the
variable" would be a better (read: "accurate") way for me to have worded
that. That nothwithstanding, nowhere else in CF that I know of (I am
prepared to be corrected) do you have a situation of a variable being
created without it also being initialised. Why here?
And indeed CF *can't handle* that situation if you *do* manage to
contrive it (as per your other posting, and my reply to it).
Adam
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]