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

referents-displayed

 
 

Syntax

with referents-displayed (& open-modifier)


Purpose

This modifier allows referents to be written to the stream. The referents are immediately converted to a string expression identifying the name of the referent and its current value. This string expression is an ordinary value. No replacement is done when referents are resolved.

The purpose of this modifier is to allow referents to be written to streams without buffering those streams until referents are resolved, and to display something useful when doing so. This is primarily useful in programmer-generated errors, warnings, or information messages, where the contents of a buffer containing referents needs to be displayed.

For example, the following block of code write the same referent to two files, one with referents-allowed modifier and the other with referents-displayed.

  process
     using output as (file "foo.txt" with referents-allowed) &  (file "bar.txt" with referents-displayed)
        output referent "greeting"
  
     set referent "greeting" to "Hello, World!"

After the run, the contents of the file foo.txt will be

  Hello, World!
and file bar.txt will contain
   <?REF "greeting">

    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.