How to Use Hint & Description with ColdFusion
The ColdFusion scripting language represents a language that programmers can embed directly into HTML. Despite its flexibility, ColdFusion offers programmers extensive tools to enhance the performance of their scripts. For example, you can add descriptions to your ColdFusion functions so that other programmers can understand what you planned to do with the function. You can add hints to your functions, so that you can display meta-data about the program for purposes of introspection.
Instructions
-
-
1
Define a function in a ColdFusion script. It can perform whatever action you see fit:
<cffunction name="exampleFunction">
/*arbitrary code*/
</cffunction> -
2
Give the function a description. This description gives a brief description of what te function does, or what it is intended to do. This description gives other programmers a glimpse at what the function does:
<cffunction name="exampleFunction",
description="A function to count camels"
>
/*arbitrary code*/
</cffunction> -
3
Give the function a hint. This attribute works with ColdFusion tools to generate documentation for the function. ColdFusion introspection means that ColdFusion tools can look at ColdFusion Components and generate documentation about that function and use that documentation in the script. The "hint" tag is more suited for this use then the general "description" tag:
<cffunction name="exampleFunction",
description="A function to count camels"
hint = "A camel counting function that takes no arguments and returns counted camels"
>
/*arbitrary code*/
</cffunction>
-
1