Its been like that since the intro of UDF's in CF5. You can also
access them via an array as well. If you go through some of the code
from CFLib.org, you'll see a fair number of UDF with this sort of
syntax:
function formToHidden(){
//a variable for iterating
var key = "";
//should we exlude any? by default, no
var excludeList = "FIELDNAMES";
//a variable to return stuff
var outVar = "";
//if there is an argument, it is a list to exclude
if(arrayLen(arguments))
excludeList = excludeList & "," & arguments[1];
//now loop through the form scope and make hidden fields
for(key in form){
if(NOT listFindNoCase(excludeList,key))
outVar = outVar & "<input type=""hidden"" name=""" &
key & """
value=""" & htmlEditFormat(form[key]) & """>";
}
return outVar;
}
In this case you can pass in an optional argument using the cfscript structure.
regards,
larry
On 10/22/07, Matt Williams <[EMAIL PROTECTED]> wrote:
>
> Maybe it is known or expected, but I was surprised it works. If you
> pass arguments to a function, but don't declare them via the
> cfargument tag, it exists anyway. You lose the name of the argument,
> but can still access it via the arguments struct.
--
The real problem is not whether machines think but whether men do. -
B. F. Skinner -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CFCDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cfcdev?hl=en
-~----------~----~----~----~------~----~------~--~---