Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

iSeries / AS400 FAQ : Programming : RPG : How do I handle the FREE opcode in ILE RPG?

0
10 Posted

iSeries / AS400 FAQ : Programming : RPG : How do I handle the FREE opcode in ILE RPG?

0

When converting RPG/400 to ILE RPG, the converted program has to do something about any FREE opcodes in the program. In RPG/400, the FREE opcode had one of three possible purposes. The third purpose listed here seems to be the most common. • Refresh the freed program so the next time it was called, it got reinitialized variables (same as if it had SETON LR the last time it was called). One fairly easy way to replace it is to change the program in factor 2 so that if you call it without parameters it just sets on LR and returns. Then replace any FREE to that program to CALL without parms. (If it is currently called without parms, set it up so it sets on LR if 1 parm is passed.) You can also run the freed program in a different activation group and reclaim the activation group instead of doing the FREE. This isn’t a good solution for a quick fix though – the use of activation groups should be carefully planned. • Make the program with the FREE opcode “forget” which program it had just ca

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.