Skip to main content

ForceGenerate (Method Keyword)

Specifies whether the method should be compiled in every subclass. Applies only if the method is a method generator.

Usage

To specify that the method (a method generator) should be compiled in every subclass, use the following syntax:

Method name(formal_spec) As returnclass [ CodeMode = ObjectGenerator, ForceGenerate ] 
{    //implementation }

Otherwise, omit this keyword or place the word Not immediately before the keyword.

Details

In the case of a method generator method, specifies that the method should be compiled in every subclass. This keyword is useful when you need to ensure that each subclass has its version of the method. InterSystems IRIS does not recompile a method in a subclass if the generated code looks the same as the superclass generated code. This logic does not consider whether the include files are the same for both classes. If the method uses a macro that is defined in an include file and if the subclass uses a different include file, InterSystems IRIS would not recompile the method in the subclass. In such a scenario, specify ForceGenerate for the method generator.

Default

If you omit this keyword, the method is not compiled in every subclass.

See Also

FeedbackOpens in a new tab