How to specify argument attributes in CFscript? (CF9)

In the CF9 doc: Defining components and functions in CFScript , he 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 indicate arg1Attribute? I tried this:

public void function setFirstname(string firstname="" displayName="first name"){}

but it does NOT work.

Also, how do you translate this into script-style?

<cffunction name="setPerson">
  <cfargument name="person" type="com.Person"/>
</cffunction>

I tried:

function setPerson(com.Person person){}

and it does NOT work. "You cannot use a variable reference with operators." "In this context," the report said.

+3
source share
3 answers

fixed in CF9 update 1

/** This is setPerson function hint
*  @person this is person argument hint
*/
function setPerson(com.Person person){}

This will work, but CFBuilder (starting with version 1.0) will consider this unacceptable.

+1
source

, . script. , , , . . com Person.

+6

, Java COM *.

import Path.To.Your.CFC.*; 

ArgType. , , " " CF- , , CF .

"" 3 .

0

Source: https://habr.com/ru/post/1720521/


All Articles