Contents

cfdefaultcase

Description

Handles the default case when no other case matches the expression in a switch statement.

Category

Other

Implemented

Usage Syntax

<cfdefaultcase /> 

[] = Optional attribute

Attributes

No Attributes

Example Usage

Example 1:

<cfloop list="bark,meow,moo,neigh,woof,ker-splat" index="sound">
	<div>
		<cfoutput>
			<cfswitch expression="#sound#">
				<cfcase value="bark,woof">
					Found a dog!
				</cfcase>
				<cfcase value="meow">
					Found a cat!
				</cfcase>
				<cfcase value="moo">
					Found a cow!
				</cfcase>
				<cfcase value="neigh">
					Found a horse!
				</cfcase>
				<cfdefaultcase>
					What animal makes a "#sound#" sound!?!
				</cfdefaultcase>
			</cfswitch>
		</cfoutput>
	</div>
</cfloop>