[Top] [All Lists]

Re: Functions with Optional Arguments

Subject: Re: Functions with Optional Arguments
From: "Dan Bracuk"
Date: Fri, 24 Aug 2007 20:14:33 +0000 UTC
Newsgroups: macromedia.coldfusion.cfml_general_discussion
There are at least four ways to pass arguments.

 name value pairs, something like
 x=myfunction(arg1=1, arg2=4);

 just the values, and they have to be in expected order, something like
 x= myfunction(1,4);

 My personal favourite is to use the argumentcollection keyword.
 x= myfunction (argumentcollection = SomeStructure));

 Something I never use is <cfinvokeargument>, but it's available.

 Bypassing optional arguments is done within the function itself.  You can use 
isDefined() to see there, and then if/else logic.

<Prev in Thread] Current Thread [Next in Thread>