Caché Class Definition Reference
ForceGenerate
[Back] [Next]
   
Server:docs1
Instance:LATEST
User:UnknownUser
 
-
Go to:
Search:    

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. Caché 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, Caché 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