On Thu, Sep 11, 2008 at 11:15 AM, Robert Nurse <[EMAIL PROTECTED]> wrote:

> Hi All,
>
> I've got a function that takes four (4) arguments.  Two of which are not
> required.  They both have default values set up in their <cfargument...>
> tags.  When I call the function without one/both of them, I get an error.  I
> vaguely remember a way to make the call in such a way as to tell the
> function exactly what argues I'm using.  So, for example:
>
> <cffunction name="myfunc" ...>
> <cfargument name="arg1" type="string" required="yes">
> <cfargument name="arg2" type="string" required="yes">
> <cfargument name="arg3" type="numeric" required="no" default="-1">
> <cfargument name="arg4" type="boolean" required="no" default="false">
> ..
> ..
> ..
> </cffunction>
>
> If I want to call this function like this, myfunc("string1", "string2",
> false), how would I make sure the function knows which argument I'm
> referring to.
>

use named arguments.  myfunc(arg1="string1",arg2="string2",arg4=false)

-- 
I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:312378
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to