A
Ashton Woods
Guest
We have a folder with many classes that inherit from the same base class. Their names are formatted like this:
The program should scan this class folder and create a temp-table with the class-name prefix and count (f.ex "firsttypesubclass" and count=3):
DEFINE PUBLIC TEMP-TABLE TT_AllSubClasses NO-UNDO
FIELD Name AS INT /* f.ex "firsttypesubclass" */
FIELD Name AS INT /* f.ex "firsttypesubclass" */
.
Then we need to create new instances dynamically according to the found classes in a loop like this:
DEF VAR newInstance AS CLASS myBaseClass NO-UNDO.
testi = DYNAMIC-NEW TT_AllSubClasses.Name + "_" + STRING(1)(123123) NO-ERROR.
Is there any convinient way to list the class names in the folder? Or is it possibly to get all classes that inherit from the baseclass? I'm thinking about using the file system for checking up the files.
Continue reading...
- firsttypesubclass_1.cls
- firsttypesubclass_2.cls
- firsttypesubclass_3.cls
- secondtypesubclass_1.cls
- secondtypesubclass_2.cls
The program should scan this class folder and create a temp-table with the class-name prefix and count (f.ex "firsttypesubclass" and count=3):
DEFINE PUBLIC TEMP-TABLE TT_AllSubClasses NO-UNDO
FIELD Name AS INT /* f.ex "firsttypesubclass" */
FIELD Name AS INT /* f.ex "firsttypesubclass" */
.
Then we need to create new instances dynamically according to the found classes in a loop like this:
DEF VAR newInstance AS CLASS myBaseClass NO-UNDO.
testi = DYNAMIC-NEW TT_AllSubClasses.Name + "_" + STRING(1)(123123) NO-ERROR.
Is there any convinient way to list the class names in the folder? Or is it possibly to get all classes that inherit from the baseclass? I'm thinking about using the file system for checking up the files.
Continue reading...