cfsilent night…

Written on 9 December 2014, 09:12pm

Tagged with:

An interesting bit about the cfsilent tag.
The official example from Adobe on the cfsilent page is the following:

<h3>cfsilent</h3>

<cfsilent>
<cfset a = 100>
<cfset b = 99>
<cfset c = b-a>
<cfoutput>Inside cfsilent block<br>
b-a = #c#</cfoutput><br>
</cfsilent>

<p>Even information within cfoutput tags does not display within a 
cfsilent block.<br>
<cfoutput>
b-a = #c#
</cfoutput>
</p>

As expected, nothing between the cfsilent tags is displayed:
before

But what do you think it happens if you add a cfabort on line 9, right before closing the cfsilent tag? 🙂


<h3>cfsilent</h3>

<cfsilent>
<cfset a = 100>
<cfset b = 99>
<cfset c = b-a>
<cfoutput>Inside cfsilent block<br>
b-a = #c#</cfoutput><br>
</cfabort></cfsilent>
...

This happens:
after

The c variable content is suddenly displayed (-1), but not the other text inside cfoutput. A bit strange if you ask me…

Leave a response