swirl
Guide to OmniMark 9   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
 
 
 

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.