The 'this' identifier

The "this" identifier is required to access member variables and methods from within a class.

The following examples illustrate the use of the "this" identifier. The first example shown illustrates the correct use of "this".

define class Circle
    double CenterX
    double CenterY
  Private
    double Radius
    double Area
  EndPrivate
enddefine

define method SetArea() on Circle
	this.Area = 3.14159*this.Radius*this.Radius
enddefine

define method GetArea() on Circle
	return (this.Area)
enddefine

define method SetRadius(rad) on Circle
    this.Radius = rad

	! update Area
	call this.SetArea()
enddefine

Note that every time a member variable is accessed it must be preceded by the "this" identifier. If "this" is not included EASI will not find the specified member variable

Consider the case where the SetRadius() method was replaced with the following method.

define method SetRadius(rad) on Circle
    Radius = rad

	! update Area
	call this.SetArea()
enddefine

The SetRadius() method will not run because "this" is required before the member variable Radius. Instead, EASI will look for a global variable named Radius, instead of a member variable named Radius.

Consider the case where the SetRadius() method was replaced with the following method.

define method SetRadius(rad) on Circle
    this.Radius = rad

	! update Area
	call SetArea()
enddefine

The SetRadius() method will not run because "this" is required when calling the method SetArea. Instead, EASI will look for a global function called SetArea(), instead of a mthod of Circle called SetArea.

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.