swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax    
action  

reopen

 
 

Syntax

  reopen stream-name indexer? open-modifier?


Purpose

The reopen action is used to open an existing stream object that was previously closed using the close action. Unlike with the openaction, 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"

If the reopen new form is used, a new item is added to the specified stream shelf. The restrictions on this form of thereopen action are the same as those of the set new action. In this case, the attachment must be specified.

All of the open modifiers available for the open action are available for reopen except append, text-mode, binary-mode, buffered, and unbuffered.

When reopening a stream:

Previous versions of OmniMark allowed an attachment to be specified when reopening a stream:

    process
       local stream s

       reopen s as file "foo.txt"

This had the effect of opening the attachment in append mode. This form of the reopen action is deprecated and should no longer be used. In its place, the append modifier should be used with the open action:

    process
       local stream s

       open s with append as file "foo.txt"

    Related Syntax
   binary
   break-width
   file
   open
   referents
   text-mode
 
 
 

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

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:45:42 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.