swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax   Related Concepts  
action  

open

 
 

Syntax

open stream-reference open-modifiers? as attachment

   where stream-reference is

      stream-name

   or

      new shelf-name ({string-expression})? insertion-point?


Purpose

Setting a stream to open allows it to be written to and causes previous contents to be lost, just as though the stream had been discarded.

If the second form is used for the stream reference, where the open keyword is followed immediately by the new keyword, a new item is added to the specified stream shelf. The restrictions on this form of the open action are the same as those of the set new action.

A stream can be opened if it is:

The permitted attachments are:

Open modifiers are modifiers that affect how the stream is opened. If more than one open modifier is specified, they must be enclosed in parentheses and separated by "&". Each modifier can be specified only once. The modifiers are:


  local stream x
  ...
  
  open x with binary-mode as file "y"
  open x with buffered as file "y"
  open x with unbuffered text-mode as file "y"

This code fragment includes three different open...as file statements. The first two are equivalent, though the second is the more efficient form of the statement. The third action is different.

The first action opens x in binary mode with the name "y".

The second action opens x as a buffered file with the name "y".

The third action opens x as an unbuffered file in text mode with the name "y".

In previous versions of OmniMark, the keyword file could be omitted. This is deprecated, and may be removed in a future version of the language.

    Related Syntax
   file
   reopen
 
Related Concepts
   Buffering I/O
   Files: binary-mode and text-mode
   Output
   Variables and Constants
 
 

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

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:33:48 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.