Try OpenEdge Now
skip to main content
Object-oriented Programming
Programming with Class-based Objects : Using static members of a class
 

Using static members of a class

As previously described, you can define certain members of a class as static (see Usingthe CLASS construct). Defining a member as static scopes it to the defining class type and makes it available for the duration of the ABL session, rather than scoping it to a class instance for the duration of the object, as with instance members. You do not need to instantiate a class in order to initialize and access its static members; for all static members defined with appropriate access modes, you only need to have access to the class type that defines them in order to access them. Thus, static members of a class automatically become initialized after your first reference to that class type, and you can access these static members directly as components of that class, independent of any instances of the class you might also have created or deleted.
The following sections describe additional basic features of static members and a common use case:
*Staticmember scoping
*Accessingstatic members
*Definingstatic members
*Initializing and deleting static members
*Commonuse case for static members
*Static type-name syntax and naming conflicts
* Static member scoping
* Accessing static members
* Defining static members
* Initializing and deleting static members
* Common use case for static members
* Static type-name syntax and naming conflicts