swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax   Related Concepts  
declaration/definition  

declare catch

 
 

Syntax

(declare | export | require) catch catch name catch argument list


Purpose

You can use declare catch to declare the name and the parameters of a catch that you will use elsewhere in your program. The following declares a catch named no-planet:

     declare catch no-planet

A catch declared in a module may use export instead of declare to make it available to the importing program or module.

A catch declared in a module may use require instead of declare. The program or module that imports this module must supply a catch, using a supply clause in the import statement. The supplied catch must match the required one in all respects except its name and the names of its arguments.

The catch declaration can also declare parameters, following the same form as function parameters. value, modifiable, read-only, and write-only are supported, but not remainder. The optional keyword is not supported. All heralded catch arguments are optional by default. See define function for a full description of function parameters.

The following is an example of a catch declaration with parameters:

     declare catch invalid-item       value string  the-item
                                error value string  the-error
                                times value integer num-times

catches can use either the heralded or parenthesised form for declaring arguments, just like function definitions. The same considerations as for functions apply to choosing one or the other.

It is a compile-time error to use a catch that has not been declared. It is also a compile-time error to declare the same catch twice.

    Related Syntax
 
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.