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

has name

 

 

Return type: Boolean
Returns:       

Returns true if the specified stream item has a name, and false otherwise. Replacing has with hasnt will return the opposite results.



Syntax
  stream-name indexer? (has | hasnt) name


Purpose

Streams that are attached to files, referents and external functions have names. Also, the built-in stream #markup-parser can have the name "XML" or "SGML."

If the stream has a name, the name of operator can be applied to the stream item to return a string expression containing the name of the stream.

The built-in stream #main-output has a name when it has been attached to a file on the command line that has "-of" or "-aof" options.

This example illustrates the use of has name to test whether a specified stream has a name. This is done in order to avoid the error of using the name of test on a stream that does not have a name.

  global stream new-output
  ...
  do when new-output has name
    do unless name of new-output = "new-out.txt"
      put #error "stream new-output has unexpected name: "
      put #error name of new-output
      halt with 1
    done
  else
    put #error "new-output was never opened " _
               "as file or referent%n"
    halt with 1
  done

    Related Syntax
   #main-output
   #markup-parser
   external-function
   name of
   referents
 
 
 

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

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

Copyright © Stilo Corporation, 1988-2005.