iPgm parameters: Make declarations for parameter types easier to use
Hi!
This is rather a nice-to-have than an actual issue, but it seems to be worth to mention it. In our company, we currently modernize our ILE RPG software. Hence we go for free format. As far as I‘ve seen, we need to declare parameter types for iPgm with the classic format („10A“ instead of „char(10)“). May it be possible to support free format syntax in iPgm functions as well?
If I got it correctly, this may also be something that needs to be changed in the XMLSERVICE layer (?)
This is just syntactic sugar. But in long term, it may be better maintainable to have the same syntax in both definitions.
I agree with this proposal completely. I am guessing if XMLSERVICE had the change, the the itoolkit modules for python, Node, PHP, Ruby could all benefit "for free" with no changes (but I haven't looked at the code).
I would suggest an issue on XMLSERVICE regardless, at http://github.com/IBM/XMLSERVICE
As suggested, I opened an issue https://github.com/IBM/xmlservice/issues/43. Should I still leave this issue open, or would you prefer me to close it?
I don't agree with this proposal. If anything, we should be reducing our coupling with RPG, not strengthening it. XMLSERVICE is a low-level service and its implementation should be shielded by the toolkits, though the Node toolkit went rather away from this for whatever reason.
I'd rather see wrapper classes for the different types and have them translate it in to what XMLSERVICE wants.
Seems like a better options
This should be rather easy to implement.
My idea is to create a class (e.g. itypes) which exports constant functions.
Example:
const char = (chars) => return chars.toString() + “A“;
So you could use it like:
pgm.addParam(”dummy”, itypes.char(10));
What do you think about that?
This approach would still be compatible with existing implementations.
Seems good to me. I'd probably forgo the class and just have a module that exports the functions.
Also FYI, going forward the intent is to drop the "i" prefix from things.
:wave: Hi! This issue has been marked stale due to inactivity. If no further activity occurs, it will automatically be closed.