On Dec 8, 2006, at 2:09 PM, Norman Palardy wrote:


On Dec 08, 2006, at 11:58 AM, Charles Yeomans wrote:


I wouldn't expect it to because of the nature of the string concatenation in this code. Below is a version that replaces the string concatenation with something faster. I also changed the while loop to a do loop and replaced the evil Close methods.

EVIL close methods ?
Is there something about closing an input out output text stream that is "evil" ?


There is no way to reopen a stream. There is no way to check whether a stream has been closed. Setting the object reference to nil when you're finished with it means that you don't need to check whether it's been closed. And should you ever refactor your code so as to pass a reference to that stream to another method, your code has a better chance of working.




I do find it interesting you use "do until" where the original poster and I opted for "while ..." Just an observation as I doubt there are any performance differences and both read equally easily

I find

 do until t.EOF

to be simpler than

while not t.EOF.

It is a very minor difference, to be sure. In general I prefer using do-loop to while-wend because in loops of any complexity I usually check the exit condition in the loop.

Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to