R-code structure
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
R-code is divided into multiple segments of varying length. Each r-code file contains an object header and segment location table followed by the actual r-code segments. The object header is a fixed-length descriptor that identifies the file as an r-code file and contains information about the version and size of the r-code file. The segment location table is a variable-length descriptor that contains the size and location of each r-code segment in the file. The maximum size for all segment types is 4MB.
The following table describes and lists the types, maximum size, and maximum number of segments in an r-code file.
| Segmenttype | Max.size | Max.number | Description |
|---|---|---|---|
| Action code | 4MB | 1 for main procedure1 per internal procedure | Holds the actual executable code in the form of action cells. Action cells drive the ABL interpreter and contain the executable code for ABL verbs. There is one segment for the main procedure, and one separate segment for each internal procedure. |
| Expression code | 4MB | 1 | Holds the executable expressions in Reverse Polish Notation (RPN) for the main procedure, all internal procedures, and all trigger blocks." |
| Text | 4MB | 1 per language | Holds all literal character strings for the r-code file. There is one text segment for the default language and one for each language specified in the COMPILE statement. Duplicate literals are removed. Only one text segment is loaded into memory at run time. |
| Initial value | 4MB | 1 | Contains information required to initialize an r-code file for execution, including database and table references, variable definitions, TEMP-TABLE and WORK-TABLE definitions, a list of defined frames, CRCs, and time stamps. There is one initial value segment per r-code file. |
| Frame | 4MB | 1 per frame | Contains layout information for a frame, including frame fields, attributes, and all RPN expression code from the frame phrase. There is one frame segment for each named and unnamed frame in the r-code file. Each frame segment has a 32K limit. |
| Debugger | 4MB | 1 | Used by the Application Debugger to maintain the debugger context for the procedure. There is one debugger segment per r-code file. This segment is loaded into memory on demand only when the Debugger is active. For information about the Debugger, see Troubleshoot ABL Applications. |