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

not-reached

 
 

Syntax

  not-reached (message string-expression)?


Purpose

You can use the not-reached statement to verify that a position in your code that you do not expect to be reached is in fact not reached. OmniMark throws to #program-error (error code 6133) if a not-reached statement is executed. You can add a message to the throw by specifying a message parameter.

For example,not-reached can be useful in branching constructs where all the values used to select a particular action fall within a certain range:

  do scan command
     match "go" =|
         ;go
     match "pause" =|
        ;pause
     match "stop" =|
        ;pause
     else
        not-reached message 'Unknown command "' || command || '"'
  done

Note that not-reached is functionally equivalent to the expression assert false. You should choose whichever form is most expressive in the context you use it in.

    Related Syntax
   assert
 
 
 

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

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

Copyright © Stilo Corporation, 1988-2005.