On Jul 30, 2006, at 11:33 PM, Terry Ford wrote:


On Jul 30, 2006, at 8:01 PM, Lennox Jacob wrote:

Hi Terry,
I have it working on one computer (If f.exists) which I use for programming and my private files and is not (never) connected to the Internet. I then typed it in on the other computer (which has none of my project files or any of my private files) and is connected to the Internet so that I can "speak/chat/correspond" on the Internet, it was typed as "If f exists" the first time, but then I did not type it again, I copied and pasted it so it was copied and pasted with the same error.

I was just teasing you. :)

You wouldn't have been able to compile it without the correct syntax.

One thing that caught my attention throughout the thread was the reference to tOS=Nil as opposed to tOS.Close as I learned before. According to RS, the stream and the reference to it should automatically disappear at the end of the method if it was declared in the method and tOS.Close is not required. I could see the reference not disappearing if tOS were a property however.

What I have discovered is that, if you wish to write to and then read from the same folderitem in the same method, making the reference nil will actually close the write for the next read.

Right. More precisely, the file is closed when the last reference to the stream is destroyed. As long as a stream object is created and destroyed within the scope of a method, and not passed to other methods, there is no harm in calling Close. But I think it is the better practice not to use it, so that when I do pass a stream object around, I don't close it while another method expects it to be open.

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