swirl Guide to OmniMark 5   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesOMX VariablesErrors
 
  Related Syntax    
operator   referents is attached    

Return type: Boolean
Returns:       

Returns true when the contents are defined or have been defined, and false otherwise. Replacing is with isnt will reverse the results



Syntax
  this? referents indexer? (is | isnt) attached


Purpose

A referent is attached when its contents have been defined. However, the referent is no longer attached if a particular referent's contents have been specified, the referent has been closed, and the stream bound to that referent is subsequently discarded.

this indicates the currently selected referent. Indexer is a phrase identifying which referent is to be examined. The two cannot be combined.

This code sample illustrates using the "referents...is attached" test. The sample also shows that if a referent has been closed and the stream bound to that referent discarded, then the referent is no longer attached.

  macro attach-check token ref-name is
    do when referents{ref-name} is attached
      output "attached%n"
    else
      output "not attached%n"
    done
  macro-end

  output referent "x"        ; referent "x" is not attached
  attach-check "x"
  open s as referent "x"     ; referent "x" is attached now
  attach-check "x"
  put s "some contents%n"    ; still attached
  attach-check "x"
  close s                    ; still attached
  attach-check "x"
  discard s                  ; referent "x" is no longer attached
  attach-check "x"
  set referent "x" to "more contents%n"
  attach-check "x"           ; attached now so we end up with a value

    Related Syntax
   referents
 
 
----  

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

Generated: August 11, 2000 at 3:07:44 pm
If you have any comments about this section of the documentation, send email to docerrors@omnimark.com

Copyright © OmniMark Technologies Corporation, 1988-2000.