Home  /  Application Development: Core Topics  /  Class Definition Reference  /  Method Keywords  /  ForceGenerate

Class Definition Reference
[Back]  [Next] 
InterSystems: The power behind what matters   

Specifies whether the method should be compiled in every subclass. Applies only if the method is a method generator.
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 ]
Otherwise, omit this keyword or place the word Not immediately before the keyword.
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.
If you omit this keyword, the method is not compiled in every subclass.
See Also