Page 1 of 1

Can Rich Display File coexist with traditional Display File?

Posted: Fri Apr 23, 2010 4:54 pm
by Profound Logic
Question:
Can Rich Display File coexist with traditional Display File within the same RPG program to cater to those two different environments?

Answer:
Yes, this is definitely possible. You can put the HANDLER keyword within an IF DEFINED directive. Then, you can compile the program for green-screen output as you would normally over the green-screen display file. When compiling the rich user interface copy of the same program over the rich display file, you can specify the OPTIONS(‘DEFINE(…)’) parameter to pick up the HANDLER keyword.

It is also possible with a little more programming to create 2 separately named display files (one for rich ui and one for green screens) with the UsrOpn keyword. Then, your program can OPEN the appropriate display file based on context. With this method, you will only have one program object.