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

set file

 
 

Syntax

  set file string-expression open-modifiers to string-expression


Purpose

A convenient way to create a file when the entire contents can be described with a single string-expression. It can be used anywhere that the sequence open...as file, put, close would be used. As an example:

  down-translate
  ...
  element  copyright
     set file "copy.txt" to "%c%n"

The same open modifiers that can be used for open can be used for set file.

set file is a convenient way to copy files, but is most useful when the right side refers to an external source function.

The string-expression is only evaluated as needed. This means that if the string expression consists of any of the following, alone or in a join operation, they are processed "as needed". If the string-expression contains:

file followed by a filename, then the file can be read incrementally, allowing large files to be processed.

a call to an external source function, then:

any stream-returning function call, then that function call will be executed at the point where its text is required. The #current-output set inherited by the function is an anonymous buffer used to buffer the output until it can all be copied to the destination stream at the end of the action.

    Related Syntax
   close
   file
   put
 
 
 

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

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

Copyright © Stilo Corporation, 1988-2005.