Hey Dick,
I've done a similar thing, but didn't create the external
CFBufferedReader class. Do you see any reason why the following wouldn't
provide the same?
<cfscript>
filename = "c:\cfusionmx\wwwroot\lineNumberReader.cfm";
fileReader = createObject("java", "java.io.FileReader");
fileReader = fileReader.init(filename);
lineReader = createObject("java","java.io.LineNumberReader");
lineReader = lineReader.init(fileReader);
</cfscript>
<cfset eof = false>
<cfloop condition="not eof">
<cfset thisLine = lineReader.readLine()>
<cfif not isDefined("thisLine")>
<cfset eof = true>
<cfelse>
<cfoutput>#htmlEditFormat(thisLine)#<br></cfoutput>
</cfif>
</cfloop>
(when lineReader instance hits the end of the file, readLine() returns
a result that causes thisLine to become undefined in the eyes of CF)
-joe
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]