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().
...
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?


I think your cfdump is overstepping its bounds--but it's not the only one.

<cfcomponent>
  <cffunction name="func" output="true">
    <cfargument name="arg" required="no" />
    <cfdump var="#arguments#" label="f1 arguments" />
    <cfoutput>
      #ArrayLen(arguments)#,
      #StructKeyList(arguments)#,
      #IsDefined("arguments.arg")#
    </cfoutput>
    <cfif arguments.arg>arguments.arg exists</cfif>
  </cffunction>
</cfcomponent>

results in:

f1 arguments - struct
ARG     [undefined struct element]
1, ARG, NO

Error Occurred While Processing Request
Element ARG is undefined in ARGUMENTS.


So, IsDefined() catches that arg doesn't exist, but all the other tests believe it does. Looping over the key list or array will throw errors. Bad, bad, bad. Now I gotta go review a buncha code...


--

    Ben Curtis
    WebSciences International
    http://www.websciences.org/
    v: 310 478 6648
    f: 310 235 2067






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