CFLib.org – Common Function Library Project

Flush(interval)

Last updated April 22, 2003

author

Eric C. Davis

Version: 2 | Requires: CF6 | Library: CFMLLib

Description:
This UDF enables flushing of content during cfscript routines.

Return Values:
Returns nothing.

Example:

<cfscript>
 for (i=1;i LTE 10;i=i+1) {
  WriteOutput("i=" & i & "<br>");
  //Disabled here because of how we run examples...
  //Flush();
 }
</cfscript>

Parameters:

Name Description Required
interval Flushes output each time this number of bytes becomes available. Yes

Full UDF Source:

<!---
 Mimics the CFFLUSH tag and sends all content to the screen.
 Version 2 by RCamden (ray@camdenfamily.com)
 
 @param interval      Flushes output each time this number of bytes becomes available. (Required)
 @return Returns nothing. 
 @author Eric C. Davis (cflib@10mar2001.com) 
 @version 2, April 22, 2003 
--->
<cffunction name="flush" returnType="void">
    <cfargument name="interval"  type="numeric" required="false">
    <cfif isDefined("interval")>
        <cfflush interval="#interval#">
    <cfelse>
        <cfflush>
    </cfif>
</cffunction>

Search CFLib.org


Latest Additions

Raymond Camden added
QueryDeleteRows
November 04, 2017

Leigh added
nullPad
May 11, 2016

Raymond Camden added
stripHTML
May 10, 2016

Kevin Cotton added
date2ExcelDate
May 05, 2016

Raymond Camden added
CapFirst
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson