Advantages of using portable r-code
- Last Updated: April 25, 2023
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
ABL r-code is the intermediate binary code that OpenEdge generates when it compiles ABL source files. This is the code that is actually run when a procedure is executed. ABL r-code is portable between two dissimilar platforms if all of the following apply:
- The source code is not dependent on the user interface
- The source code is not dependent on DataServer connections
- The platforms are compatible between 32-bit and 64-bit architecturesNote: You can run r-code that was compiled by OpenEdge running on a 32-bit platform in a PAS for OpenEdge instance, but PAS for OpenEdge only installs and runs on a 64-bit platform.
For more information, see the sections on portable r-code in Manage ABL Applications.
Using portable r-code, you can perform PAS for OpenEdge development on a platform that is different from your PAS for OpenEdge deployment platform. For example, you can compile r-code that is destined to run on a UNIX 64-bit PAS for OpenEdge session on a Windows ABL client. Further, this means that by compiling on the Windows ABL client, a compiler license for the UNIX platform is not required.
Note the following cautions if you intend to use portable r-code:
- Examine your code for platform-specific code blocks. The presence of these code blocks can limit your ability to make your r-code portable.
- Ensure that your ABL code addresses all target r-code platforms on which you want your code to run.
The following examples compare platform-specific preprocessor directives that will be resolved at compile time with a comparable ABL code that is resolved at run time.
Preprocessor directive resolved at compile time:
|
Non-preprocessor ABL code resolved at run time:
|
"WIN32" logic would be executed even if the resulting
r-code is run by an server session on a UNIX host. Therefore, if there can be multiple
deployment platforms for server session code, you should use run-time resolution for
platform-specific blocks as the second code example in this section shows.&OPSYS and OPSYS, the value "WIN32"
refers to both 32-bit and 64-bit Windows platforms. If you want to know if the
current platform is 32-bit or 64-bit, test the value of
&PROCESS-ARCHITECTURE or
PROCESS-ARCHITECTURE.