Try OpenEdge Now
skip to main content
Object-oriented Programming
Developing and Deploying Classes : Accessing class definition files using the Procedure Editor : Checking and running a class from the Procedure Editor
 

Checking and running a class from the Procedure Editor

The RUN functionality from the Procedure Editor (F2 for GUI, F1 for character mode) allows you to instantiate a class definition file from the current edit buffer, based on the file extension of the edit buffer. If the current edit buffer is an untitled edit buffer (that is, has not been explicitly saved as a .cls file), the Procedure Editor, by default, interprets it as a procedure file, regardless of its content. Thus, if you try to compile an untitled edit buffer that contains a CLASS or INTERFACE statement, the Procedure Editor notifies you that you have class definition file syntax and need to save the edit buffer to a file before compiling it.
If the code has been explicitly saved as a class definition file, the Procedure Editor interprets it as a class definition file, again, regardless of its content. Thus, it will compile only if it contains a CLASS or INTERFACE statement. That is, when running the current edit buffer, the Procedure Editor does not initially parse the source code to check for the presence of the CLASS or INTERFACE statement, but relies entirely on the filename extension with which the file has been saved to determine what syntax it needs to check for (class or procedure syntax).
In addition, depending on whether the current edit buffer has been saved to or loaded from a file or is untitled (never saved to a file), the Procedure Editor handles code a little differently when checking the syntax or running the code.
* Check Syntax option
* Run option