ASNA WingsRPG™ Reference Manual |
Handler Best Practices
These are some of the best practices you may want to consider for RPG programs using ASNA Wings.
Conditional Recompile
When modernizing your RPG ILE programs, you can keep two copies of the executable program, one with the ASNAWINGS Handler keyword and the other without. This option is supported by Flight Plans with a specific OverwriteTarget tag: just select "backup" and Wings will ensure that you have a copy of the files as they were before conversion.
Alternatively, you can use one copy of the source by using an /If DEFINED /Endif coupled with the DEFINE parameter on CRTRPGMOD or CRTBNDRPG to conditionally create the compiled source with or without the HANDLER keyword at compile time.
For example, the following is a rough representation of the /IF DEFINED statement to add to your RPG source followed by two sample CRTRPGMOD commands showing one without and one with the compile DEFINE condition.
/* RPG Source
... /IF DEFINED (withwings) ... Handler ('ASNAWINGS') ... /ENDIF
CRTRPGMOD MODULE(MYLIB/CUSTINQCL) SRCFILE (MYLIB/QRPGLESRC) /* creates green screen version
CRTRPGMOD MODULE(WINGSLIB/CUSTINQCL) SRCFILE (MYLIB/QRPGLESRC) DEFINE(withwings) /* creates wings version
Separate Display Files by Source Library
When importing display files, consider creating a separate "Views" subfolders to maintain the separation in display file source that may exist in different source libraries.
Do Not Forget to Recompile
If display files are changed, export the display file and recompile the RPG programs right away. This will help prevent runtime errors if the RPG program and ASNA Wings display files are not in sync.