swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
    Related Concepts  
operator  

is thrown

 
 

Return type: Switch
Returns:       Returns true if the named throw has been thrown but has not yet been caught, and false otherwise. Replacing is with isnt will reverse the results.

Syntax

named-throw (is | isnt) thrown


Purpose

You can use the is thrown test to determine if a throw is in progress to the catch name specified.

The catch name specified can be any of the following:

A compile-time error is produced if the programmer-defined catch name is not declared within the program.

Because OmniMark allows multiple throws at the same time, you may not want to produce an additional throw while another throw is being processed. Using is thrown can avoid having multiple throws caused by the same error condition.

Actions in an always clause are always executed at the end of a local scope, whether a throw is in progress or not. A throw within an always can leave you with two throws active at once. If this is inappropriate, you can test as follows:

  do 
     submit file foo
     always
     do when count > 5000
        throw bar unless #external-exception is thrown 
     done
  done

      Related Concepts
 
 

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.