Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Previous sectionNext section


Specifies whether instance methods in this class can use the now-obsolete %this variable.


To enable instance methods in the class to use %this, use the following syntax:

Class MyApp.MyClass [ LegacyInstanceContext ]  { //class members }

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


If this keyword is true, instance methods in this class can use the %this variable, which is now obsolete (replaced by $this). If this keyword is false, instance methods cannot refer to %this.

Effect on Subclasses

This keyword is not inherited.


If you omit this keyword, instance methods cannot refer to %this.


Upon upgrade, existing classes are automatically marked with [ LegacyInstanceContext ], to preserve backward compatibility; see the chapter “Caché 2011.1” in the Caché Release Notes and Upgrade Checklist Archive.

See Also