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

set file

 
 

Syntax

set file string-expression modifier-expression? to string-expression
    


Purpose

Using set with a file expression on the left-hand side is a concise way of creating a file when the entire contents of the file can be described with a single string or a single string source expression. For example,

  define function
     f (value string        file-name,
        value string source input-data)
  as
     set file file-name to input-data
          
is equivalent to
  define function
     f (value string        file-name,
        value string source input-data)
  as
     local stream s
  
     open s as file file-name
     put s input-data
     close s
          
However, the former has the advantage of not requiring the intermediate shelf s.

As a result of this equivalence, set file can use the same modifiers as open.

    Related Syntax
 
 
 

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

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:51:21 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.