Skip to main content

Macros and Include Files in Class Definitions

Macros and Include Files in Class Definitions

In an InterSystems IRIS class definition, you can define macros in an ObjectScript method and use them in that method. More often, however, you define them in an include file, which you can include at the start of any class definition. For example:

Include (%assert, %callout, %occInclude, %occSAX)

/// Implements an interface to the XSLT Parser. XML contained in a file or binary
/// stream may be transformed
Class %XML.XSLT.Transformer Extends %RegisteredObject ...

Then any ObjectScript methods in that class can refer to any macros defined in that include file, or in its included include files.

Macros are inherited. That is, a subclass has access to all the same macros as its superclasses.

FeedbackOpens in a new tab