Hello Gio,
Am 13.08.2025 um 12:36 schrieb gio.cot via RPG400-L <rpg400-l@xxxxxxxxxxxxxxxxxx>:
In a program that manage DSPF, i would need to save all the record format fields before the EXFMT and then if the user press F3, i need to restore all the record format fields to their values before the EXFMT ..
Which could be an easy way to do that ?
I have a similar issue solved with load-paged SFLs. Code can be found here:
https://github.com/PoC-dev/as400-sfltemplates/blob/main/v_lodpagpg.rpgle
In short, I define a DS with the PFs field names in line 109, and clone that in line 112, fields being prepended by C_ (for copy) in line 112. You can do the same with a display file's recfmt. Newer versions of RPG allow you to use LIKEDS, QUALIFIED, etc. for easier code maintenance, and confinement of variables.
Later, starting Line 327, I clear and copy (MOVEL) the DS data in one go, so I don't lose the data when locking the record by a CHAIN, and copy the saved data back in line 338. I honestly can't recall why I used MOVEL and then EVAL instead of doing it in a consistent manner.
Does that help?
Note: I'm a hobbyist deliberately doing things on a stone age model 150 running V4R5.
:wq! PoC
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.