contentsconceptssyntaxlibrariessampleserrorsindex
Full text search
action   reopen    
  Related Syntax   Related Concepts  

Syntax

  reopen stream-name indexer? open-modifier? (as attachment)?


Purpose

The reopen action is used to open an existing or new stream object so that text can be appended to it. Unlike with the function open, the contents of the attached object are not erased when it is reopened.

For example, the first output action in the following process rule will output "of our discontent", and the second output action will output "Now is the winter of our discontent":

  process
     local stream foo
     local stream bar

     open foo as buffer
     put foo "Now is the winter "
     close foo

     open bar as buffer
     put bar "Now is the winter "
     close bar

     open foo as buffer
     put foo "of our discontent"
     close foo

     reopen bar
     put bar "of our discontent"
     close bar

     output foo || "%n"
     output bar || "%n"

The modifiers available for reopen depend on whether the attachment is specified.

The permitted attachments for reopen are similar to the ones for open:

Note that reopening a stream as a buffer (for example, reopen foo as buffer) is deprecated. If you want to append information to a stream that has been previously opened as a buffer, simply use the reopen action without using the as buffer suffix.

When the attachment is specified, all of the open modifiers available for the open action are available for reopen. This is because, if the stream is currently bound to a buffer, reopen as buffer is the same as reopen. If the stream is not bound to a buffer, then reopen as buffer is the same as open as buffer.

When the attachment is not specified, all of the open modifiers available for the open action are available for reopen except text-mode, binary-mode, buffered, and unbuffered.

When the attachment is specified, the reopen action behaves as follows:

When the attachment is not specified:

    Related Syntax
   binary
   break-width
   file
   open
   referents
   text-mode
 
Related Concepts
   I/O and variables
   Referents: default definitions for a reopened stream
   Referents: reopening in a different scope
   Referents: writing referents to a stream
   Streams: reopening
 
----

Top [CONTENTS] [CONCEPTS] [SYNTAX] [LIBRARIES] [SAMPLES] [ERRORS] [INDEX]

Generated: April 21, 1999 at 2:01:14 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © OmniMark Technologies Corporation, 1988-1999.