<cfset>

edit

Define a CFML variable.

If the variable exists, cfset resets it to the specified value.

This tag must stand alone — a body/content and closing tag are not allowed.

This tag is also supported within <cfscript>

<cfset #any noName#>
Attribute Description
noName
any, optional
edit

Content of the tag set

Examples

edit
<cfset arr =["I Love Lucee"] >
<cfset str.myVal ="Save water, Plant green">
<cfset intVar=10 >
<cfset char ="Smile & Enjoy your life">
<cfdump var="#arr#" label="Array" />
<cfdump var="#str#" label="Structure" />
<cfdump var="#intVar#" label="Integer" />
<cfdump var="#char#" label="String"/>
<cfscript>
	writeOutput("<br><br>Using CFscript<br><br>");
	array=["this is sample array"];
	struct.userVal=1;
	numb=1006;
	str="I'm String";
	writeDump(var=array,label="Array");;
	writeDump(var=struct,label="Structure");;
	writeDump(var=numb,label="Integer");
	writeDump(var=str,label="String");
</cfscript>

See also