swirl Guide to OmniMark 5   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesOMX VariablesErrors
 
  Related Syntax    
action   reopen    

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
 
 
----

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ OMX ] [ OMX ] [ ERRORS ]

Generated: August 11, 2000 at 3:07:45 pm
If you have any comments about this section of the documentation, send email to docerrors@omnimark.com

Copyright © OmniMark Technologies Corporation, 1988-2000.