How can I declare inside a class a structure like a file record ??
Of course, apart of the obvious solution that is copying the record inside the class.
I try to do something like:
XXX FILE,PRE(abc)
Record RECORD
...
END
END
MyClass.inc
....
r2 GROUP(abc:Record).
MyClass CLASS ...
...
END
One thing you can do is write your class with the intent of it being derived.
Then, the derived class will have the scope of your files. You can declare your structure LIKE(YourRecord) in this class, and use virtual methods for access to the specific columns that you need to act on.
what you propose appears interesting, but I don’t understand it.
My interpretation of the scope rules are:
The file record declarations are in Global data, and is visible to executable statements and expressions in every PROCEDURE in the PROGRAM.
Global data is always in scope.
Global data is allocated Static memory and is available to every PROCEDURE in the PROGRAM.
But they are not visible inside a class.
I always put a MEMBER statement in class declarations in separate files but that do not change the scope rules. Thanks for your input, marcelo