View comments | RSS feed

cfargument

Description

Creates a parameter definition within a component definition. Defines a function argument. Used within a cffunction tag.

Category

Extensibility tags

Syntax

<cfargument 
  name="..." 
  type="..." 
  required="..." 
  default="..." 
  ...>

See also

cfcomponent, cffunction, cfinvoke, cfinvokeargument, cfobject, cfproperty, cfreturn

Attributes

Attribute Req/Opt Default Description
name
Required

String; an argument name.
type
Optional
any
String; a type name; data type of the argument.
  • any
  • array
  • binary
  • boolean
  • date
  • guid
  • numeric
  • query
  • string
  • struct
  • uuid
  • variableName
  • a component name
If the value is not a recognized type, ColdFusion processes it as a component name.
required
Optional
no
Whether the parameter is required in order to execute the component method.
  • yes
  • no
default
Optional

A type; if no argument is passed, specifies a default argument value.
If this attribute is present, the required attribute must be set to "no" or not specified.

Usage

This tag must be positioned before any other tags within the cffunction tag.

Arguments that are passed when a method is invoked can be accessed from the method body in the following ways:

ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6

Comments are no longer accepted for ColdFusion MX. ColdFusion 8 is the current version.

Comments


rsogaard said on Aug 30, 2002 at 4:31 PM :
The attribute hint should be documented here as well.
chip42 said on Oct 4, 2002 at 3:55 PM :
The possible values for the type attribute should be documented. The GUID type has not appeared in previous versions and is undocumented. The UUID type is a Cold Fusion UUID [can be made with CreateUUID()] which does not mesh well with Microsoft product generated UUIDs (such as SQL server's newID() function).

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6/CFML_Reference/Tags-pt15.htm