Try OpenEdge Now
skip to main content
Object-oriented Programming
Programming with Class-based and Procedure Objects : Class-based and procedure object compatibility : Verifying the source for an r-code file at run time
 

Verifying the source for an r-code file at run time

Because ABL generates a common r-code (.r) file type for both classes and procedures, you cannot necessarily tell from the filename if a given r-code file is generated from a class or a procedure. If your application uses both procedures and classes, you might need to verify whether the source for a given r-code file is a class definition (.cls) or procedure (.p or .w) file. This can be useful, for example, if your application is or provides a tool for managing ABL classes and procedures in some way.
To distinguish r-code files that are generated for classes and procedures, ABL supports a read-only LOGICAL attribute, IS-CLASS, on the RCODE-INFO system handle. Thus, if the IS-CLASS attribute is TRUE for a specified r-code file, the source is a class definition file that defines a class or interface. If the attribute is FALSE, the source is a procedure source file.