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 : Whats the difference between CONST and VALUE?

0
10 Posted

iSeries / AS400 FAQ : Programming : RPG : Whats the difference between CONST and VALUE?

0
10

Joep Beckeringh provided this explanation: If you pass a parameter by value, you are free to change the variable defined by the procedure interface (you might want to change blanks to zeroes, double quotes, strip leading zeroes). For a CONST parameter you would have to copy to a local variable first. The point being that in both cases the caller is assured that his variable won’t be changed by the called procedure, but the called procedure can use VALUE parameters as work variables, whereas CONST parameters are not allowed to be used in any way except “read-only.

Related Questions

What is your question?

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

Experts123