I'm writing a new service program and I could do with creating an enumerated type. Can anyone think of a way to do this in ILE RPG?
I suppose I could define the types as constants in the /copy member where my prototypes are. Then the procedure where I want them to pass the enum could receive an integer. It might look a bit like this (I know the positions are wrong):
This is sort of how we used to do it in Java until they added proper enumerated types to the Java language.
Can anyone think of a neater solution?
A description of enumerated types can be found here:
I suppose I could define the types as constants in the /copy member where my prototypes are. Then the procedure where I want them to pass the enum could receive an integer. It might look a bit like this (I know the positions are wrong):
PHP Code:
DConst1 Const(1)
DConst2 Const(2)
PHP Code:
MyProc(Const1);
Can anyone think of a neater solution?
A description of enumerated types can be found here:



It makes me chuckle when I hear RPG programmers stating that RPG is as good as OO now because it has procedures and service programs. What they're really stating is that they don't understand the benefits of OO! Sorry, rant over. It's not directed at you.
Comment