ok take 2:-)

i have been tearing my hair out on a bug for a while and i think i found 
a bug
in cf 5.0, if people could try this out it would be cool

it works correctly in MX btw

basically, i believe enablecfoutputonly is broken with cfloop, an extra 
space is added after a cfoutput, there are simple workarounds listed 
below, but they don't work for complex code unless you removed all 
whitespace inside the cfloop between tags

i hope with MX and all that if this bug is a bug that macromedia fixes 
it :-)

zac


demonstration code follows:


---------------code starts snip :-) -----------------------


<cfsetting enablecfoutputonly="Yes" showdebugoutput="No">

<cfoutput>
    <h1>CFLOOP & enablecfoutputonly BUG whitespace testcase</h1>
    [EMAIL PROTECTED] Tuesday, May 07, 2002<br><br>
   
       
    first the application.cfm is only <br>
   
    #Htmlcodeformat('<cfset temp=1>')#
    <br>
   
    first line of the template is<br>
    #Htmlcodeformat('<cfsetting enablecfoutputonly="Yes" 
showdebugoutput="No">')#<br>
   
   
    this doesn't work space inserted<br>
   
    #Htmlcodeformat('<cfloop index="z" from="1" to="20">
    <cfoutput>*</cfoutput>
    </cfloop>')#<br>
   
   
</cfoutput>
<cfloop index="z" from="1" to="20">
    <cfoutput>*</cfoutput>
</cfloop>
<cfoutput>
    <hr>this works because of the 's'<br>
    #Htmlcodeformat('<cfloop index="z" from="1" to="20">
aaaa    <cfoutput>*</cfoutput>s
</cfloop>')#<br>
</cfoutput>
<cfloop index="z" from="1" to="20">
aaaa    <cfoutput>*</cfoutput>s
</cfloop>

<cfoutput>
    <br>
    <hr>
    this doesn't work because of the space between the two cfoutputs<br>
   
    #Htmlcodeformat('<cfset x=1>
<cfloop condition="x lt 20">
    <cfoutput>g</cfoutput>
    <cfoutput>*</cfoutput><cfset x=x+1></cfloop>')#   

</cfoutput>
<cfset x=1>
<cfloop condition="x lt 20">
    <cfoutput>g</cfoutput>
    <cfoutput>*</cfoutput><cfset x=x+1></cfloop>   
<cfoutput>
    <br><hr>
    this works because of no spaces between the two cfoutputs<br>
    #Htmlcodeformat('
    <cfset x=1>
    <cfloop condition="x lt 20">
    <cfoutput>g</cfoutput><cfoutput>*</cfoutput><cfset 
x=x+1></cfloop>')#<br>
       

</cfoutput>
<cfset x=1>
<cfloop condition="x lt 20">
    <cfoutput>g</cfoutput><cfoutput>*</cfoutput><cfset x=x+1></cfloop>   
   
   
   
-------------------sample output---------------------------------


CFLOOP & enablecfoutputonly BUG whitespace testcase
[EMAIL PROTECTED] Tuesday, May 07, 2002

first the application.cfm is only

<cfset temp=1>
first line of the template is

<cfsetting enablecfoutputonly="Yes" showdebugoutput="No">
this doesn't work space inserted

<cfloop index="z" from="1" to="20">
    <cfoutput>*</cfoutput>
    </cfloop>
* * * * * * * * * * * * * * * * * * * *
--------------------------------------------------------------------------------
this works because of the 's'

<cfloop index="z" from="1" to="20">
aaaa    <cfoutput>*</cfoutput>s
</cfloop>
********************

--------------------------------------------------------------------------------
this doesn't work because of the space between the two cfoutputs

<cfset x=1>
<cfloop condition="x lt 20">
    <cfoutput>g</cfoutput>
    <cfoutput>*</cfoutput><cfset x=x+1></cfloop>
g *g *g *g *g *g *g *g *g *g *g *g *g *g *g *g *g *g *g *

--------------------------------------------------------------------------------
this works because of no spaces between the two cfoutputs

    <cfset x=1>
    <cfloop condition="x lt 20">
    <cfoutput>g</cfoutput><cfoutput>*</cfoutput><cfset x=x+1></cfloop>
g*g*g*g*g*g*g*g*g*g*g*g*g*g*g*g*g*g*g*


------------output finished------

______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to