c:param

<c:param
  name = identifier
  value? = expression
  as? = type_name
  required? = boolean
  tunnel? = boolean >
  <!-- Content: sequence-constructor -->
</c:param>

Defines a package, template, function or delegate parameter.

Category
declaration
Permitted parent elements
c:delegate
c:function
c:module
c:override
c:package
c:template

Attributes

as The type of the parameter.
name The name of the parameter.
required Specifies if the parameter is required.
tunnel Specifies if the parameter is a tunnel parameter.
value The default value of the parameter.

In addition to the attributes in the preceding table, there are a number of standard attributes that may appear on any XCST element.

Initialization of Parameters

For package parameters see Initialization of Package Parameters.

Parameters that are not package parameters are initialized when the containing component or instruction is evaluated, as if the parameters were part of the following sequence constructor, even though formally they are not.

Values and Types of Parameters

A parameter is basically a variable whose value can be supplied by the caller. See Values and Types of Variables. However, parameters are always initialized, even when no value is supplied by the caller and no default value is specified, in which case the parameter is initialized with the default value of the parameter’s type, e.g. default(T) in C#.

Error Conditions

It is a compilation error if the value attribute is present when the content of the element is non-empty.

It is a compilation error if a required parameter specifies a default value.

It is a compilation error if a package or function parameter uses tunnel='yes'.

It is a run-time error if no value is supplied for a required package parameter, a required and tunnel c:template parameter, or a required c:delegate parameter.

See Also