How to specify argument attributes in CFscript? (CF9)
        Posted  
        
            by Henry
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Henry
        
        
        
        Published on 2009-10-19T23:34:21Z
        Indexed on 
            2010/04/09
            17:53 UTC
        
        
        Read the original article
        Hit count: 519
        
cfml
|coldfusion
In CF9 doc: Defining components and functions in CFScript, it says:
/** 
*Comment text, treated as a hint. 
*Set metadata, including, optionally, attributes, in the last entries 
*in the comment block, as follows: 
*@metadataName metadataValue 
... 
*/ 
access returnType function functionName(arg1Type arg1Name="defaultValue1" 
arg1Attribute="attributeValue...,arg2Type 
arg2Name="defaultValue2" arg2Attribute="attributeValue...,...) 
functionAttributeName="attributeValue" ... { 
body contents 
}
How do you specify arg1Attribute? I tried this:
public void function setFirstname(string firstname="" displayName="first name"){}
but it does NOT work.
Also, how do you translate this to script-style?
<cffunction name="setPerson">
  <cfargument name="person" type="com.Person"/>
</cffunction>
I tried:
function setPerson(com.Person person){}
and it does NOT work either. "You cannot use a variable reference with "." operators in this context" it says.
© Stack Overflow or respective owner