I'm not sure about the CFDUMP issues you're having, but declaring CFARGUMENT
actually creates the argument no matter what.  When you set required=no
without specifying a default=x, CF automatically sets its own default.  If
you don't want the argument to appear when you don't pass it, simply don't
declare the CFARGUMENT tag.

<cfcomponent>
        <cffunction name="func" output="true">
                <cfdump var="#arguments#" label="f1 arguments">
        </cffunction>
</cfcomponent>

Roland Collins

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Adam Cameron
Sent: Wednesday, January 21, 2004 3:41 PM
To: [EMAIL PROTECTED]
Subject: [CFCDev] <cfargument> tag "bug"..?

G'day (again):
And now for why I was putting <cfdump> tags in my functions in the first
place (qv)!

Back to my (now modified back to the original) sample code from my
previous post:

COMP.CFC
<cfcomponent>
        <cffunction name="func" output="true">
                <cfargument name="arg" required="no">
                <cfdump var="#arguments#" label="f1 arguments">
        </cffunction>
</cfcomponent>


CALLER.CFM
<cfinvoke component="comp" method="func">

Note I've not passed any args into func().

So why are they showing up?  I could understand this if they had a
default value set, but... No.

I've not passed them in: they should not be there.

It's like CF is "helpfully" giving the arguments a default of NULL,
which is a really dumb thing to do seeing CF has no concept of NULL.
But *why* it it creating them at all?

Scratching head.



Adam Cameron
Senior Application Developer
Straker Interactive

Ph: +64 9 3605034
Fx: +64 9 3605870
Email: [EMAIL PROTECTED]

----------------------------------------------------------
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]


----------------------------------------------------------
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]

Reply via email to