Consultor Eletrônico



Kbase P109918: How to build a collection of 4GL classes
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   26/01/2006
Status: Unverified

GOAL:

How to build a collection of 4GL classes

GOAL:

How to define an array of classes

GOAL:

How to define a class variable with EXTENTS

GOAL:

How to define a temp-table field as ProObject

FACT(s) (Environment):

OpenEdge 10.1A

FIX:

OpenEdge 10.1A does not support class variables defined with the EXTENT option, i.e.: DEFINE VARIABLE myClass AS className EXTENT 5. It will be supported in versions post 10.1A.
In order to simulate 'collections' in the 4GL, the class references have to be stored in a ProObject temp-table field.
The following is an example that shows how to store and retrieve class references from a temp-table:
DEFINE TEMP-TABLE ttObjHolder
FIELD MyObj AS ProObject.
DEFINE VARIABLE myclass AS NewClass.
CREATE ttObjHolder.
MyObj = NEW NewClass().
FIND FIRST ttObjHolder NO-LOCK.
myclass = CAST(ttObjHolder.MyObj, NewClass).
myclass:myMethod().