iSeries / AS400 FAQ : Programming : RPG : Whats the difference between CONST and VALUE?
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
- iSeries / AS400 FAQ : (Category) Programming : (Category) RPG : How can I convert a character string into a numeric value?
- iSeries / AS400 FAQ : Programming : RPG : How can I convert a character string into a numeric value?
- iSeries / AS400 FAQ : Programming : RPG : Whats the difference between CONST and VALUE?