Whatever message this page gives is out now! Go check it out!
/**
* ColdFusion treats plain comment text as a hint.
* You can also use the @hint metadata name for hints.
* Set metadata, including, optionally, attributes, (including custom
* attributes) in the last entries in the comment block, as follows:
*@metadataName metadataValue
...
*/
component attributeName="attributeValue" ... {
body contents
}/**
* Simple Component.
*/
component {
/**
* Simple function.
*/
public void function foo() {
WriteOutput("Method foo() called<br>");
}
}/**
/*@default defaultValue
* @attrib1Name attrib1Value
* ...
*/
property [type]propName;/**
*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
}/**
* @hint "This function displays its name and parameter."
*/
public void function foo(String n1=10)
description="does nothing" hint="overrides hint" {
WriteOutput("Method foo() called<br> Parameter value is " & n1);
}public function funcname(required string argument1)interface {
function method1(string arg1="Hello World!");
function method2 (string arg1="Goodbye World!");
...
}/**
* Component defined in CFScript
* @output true
*/
component extends="component_01" {
/**
* Function that displays its arguments and returns a string.
* @returnType string
*/
public function method_03(argOne,argTwo) {
WriteOutput("#arguments.argOne# ");
WriteOutput("#arguments.argTwo# ");
return("Arguments written.");
}
}/**
*Comment
*@attributeName1 attributeValue
*@attributeName2 attributeValue
*...
*/component extends="component_01"// this is a component
/**
*@hint "this is a hint for component"
*/
component displayname="My Component" {
pageencoding "Cp1252" ;
//
// The rest of the component definition goes here.
//
}//Create an instance of a component.
theComponent=createObject("Component" "myComponent");
// Get the component metadata.
theMetadata = getMetadata(theComponent);
// The component properties are in an array. Display the name
// of the first property in the array.
writeoutput("Property name: " & theMetadata.properties[1].name);cfscript>
writeoutput(new custom().foo(10));
</cfscript>/**
* custom metadata for a cfc defined using annotation as well as key-value pairs
* @cfcMetadata1 "cfc metadata1"
*/
component cfcMetadata2 = "cfc metadata2"
{
/**
* custom metadata for a property defined using annotation as well as key-value pairs
* @propMetadata1 "property metadata1"
*/
property type="numeric" name="age" default="10" propMetadata2="property metadata2";
/**
* custom metadata for a function/argument using both annotation and key-value pairs
* @arg1.argmdata1 "arg metadata1"
* output true
* @fnMetadata1 "function metadata1"
*/
public string function foo(required numeric arg1=20 argmdata2="arg metadata2") fnMetadata2="function metadata2"
{
writedump(getmetadata(this));
return arg1;
}
}<cffunction name="foo" output="true">
<cfset var x = 5>
<cfset local.y=local.x*4>
<cfset var z=[local.x,local.y]>
<cfset local.u.v={z="2"}>
<cfset zz="in Variables Scope">
<cfdump var="#local#">
</cffunction>;<cfscript>
writedump(var=myquery, label="query", show="name", format = "text");
</cfscript><cfscript>
writedump(myquery, "", "html", true)
</cfscript>