Release 10.1A: OpenEdge Application Server:
Developing AppServer Applications

> ## Advantages of using portable r-code

> Progress 4GL r-code is the intermediate binary code that OpenEdge generates when it compiles Progress 4GL source files. This is the code that is actually run when a procedure is executed. Progress 4GL 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 architectures.

> For more information, see the sections on portable r-code in OpenEdge Deployment: Managing 4GL Applications .

> Using portable r-code, you can perform application-server development on a platform that is different from your application-server deployment platform. For example, you can compile r-code that is destined to run on a UNIX 32-bit AppServer agent on a Windows Progress 4GL client. Further, this means that by compiling on the Windows Progress 4GL 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 Progress 4GL 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 Progress 4GL code that is resolved at run time.

> Preprocessor directive resolved at compile time:

>     &IF &OPSYS = "WIN32" &THEN
>       ...
>     &ELSE
>       &IF &OPSYS = "UNIX" &THEN
>       ...
>       &ELSE
>       ...

> Non-preprocessor 4GL code resolved at run time:

>     IF OPSYS = "WIN32" THEN
>       ...
>     ELSE
>       IF OPSYS = "UNIX" THEN
>       ...
>       ELSE
>       ...

> If the code from the first example is compiled on a Windows client, the `"WIN32"` logic would be executed even if the resulting r-code is run by an AppServer agent on a UNIX host. Therefore, if there can be multiple deployment platforms for AppServer agent code, you should use run-time resolution for platform-specific blocks as the second code example in this section shows.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095