You mispelled default in your second argument - therefore a default
value was not created.

=======================================================================
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
Member of Team Macromedia

Email    : [EMAIL PROTECTED]
Blog     : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: S. Isaac Dealey [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, February 25, 2003 7:43 PM
> To: CF-Talk
> Subject: 
> cffunction_arguments_"[undefined_struct_element]"_--_what_the_hell?_
> 
> 
> I'm working with a function that's designed to return 
> alternative values for "yes" or "no" from yesnoformat()
> 
> I have this code:
> 
> <cffunction name="alttext" returntype="string">
>       <cfargument name="itemid" type="string" required="true">
>       <cfargument name="no" type="string" defualt="New">
>       <cfargument name="yes" type="string" default="Edit">
> 
>       <cfset var istrue = false>
>       <cfset arguments["No"] = arguments[2]>
>       <cfset arguments.no = arguments[2]>
>       <cfdump var="#arguments#">
> 
>       <cfif not isnumeric(itemid)>
>       <cfset itemid = len(trim(itemid))></cfif>
> 
>       <cfreturn arguments[yesnoformat(itemid)]>
> </cffunction>
> 
> 
> A couple of those lines were added to see if I could work 
> around the problem, which is that where the cfdump is 
> executed, the value shown for arguments.no is "[undefined 
> struct element]" ... What I don't understand is
> -- if the key exists, how is the struct element not defined? 
> And if it was obviously able to get the value of the key "no" 
> from the cfargument tag, why was it not able to get the 
> default value "New"?
> 
> Incidentally, no exception is thrown when the value is false, 
> it just returns an empty string.
> 
> Any help greatly appreciated.
> 
> s. isaac dealey                954-776-0046
> 
> new epoch                      http://www.turnkey.to
> 
> lead architect, tapestry cms   http://products.turnkey.to
> 
> tapestry api is opensource     http://www.turnkey.to/tapi
> 
> certified advanced coldfusion 5 developer 
> http://www.macromedia.com/v1/handlers/index.cf> m?ID=21816
> 
> 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to