On Jan 23, 2007, at 11:34 AM, [EMAIL PROTECTED] wrote:

On Jan 23, 2007, at 09:31 UTC, Carlo Rubini wrote:

Does this approch hold true also for textInputStream  and
binaryStream?

Yes.  I never call .Close on anything in REALbasic; better to let the
framework do it when the object goes out of scope.

Note that if I really need a stream to be closed within a method --
perhaps because I'm about to reopen it with a different object -- I
might do something like this:

  do
    Dim inp As TextInputStream = file.OpenAsTextFile
    ...
  loop until True
  Dim bs As BinaryStream = file.OpenAsBinaryFile( True )
  ...

I use a try block occasionally for just this sort of thing.

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