|
-----Original Message----- From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]On Behalf Of Hans Boldt Steve asked: >> any plans to allow a DS and pointer to be declared as const? >> >> d pAddr s * const >> d Addr ds likeds( Address ) >> d const >> d based( pAddr ) >> Hans did not mince words and replied: >No. Hans further said: >What exactly are you trying to accomplish here with that type of >syntax? If you want to modify the value of a parameter, then pass >it by reference. If you want to modify the value of a parameter >but not change the parameter passed in the call, then pass it by >value. If you're just interested in the value passed, then just >reference it normally. I have C and C++ code that parses command strings and does some specialized scanning that I would like to port from visual C++ to ILE. These functions accept pointers as arguments, some that are pointers to const data. In some cases prototyping as %string works, but other times simply passing a pointer is best. In general I would like to find out if mix and matching C++ and RPG procedures works better than coding entirely in RPG. But the RPG limitation of setting a pointer to only non const variables will not work well with C++ which makes heavy use of const references and pointers. Basically, if RPG provides the pointer, why restrict it to only non const variables? Esp since const is such a good modular programming practice and the solution of qualifying a pointer and DS as const appears to be very doable. Does the IBM RPG dept accept customer suggestions and requests? Is there an email address that a question can be posted to? The decision to not extend const to pointers and data structs is wrong and I would like the IBM RPG person in charge to confirm and respond to my objections. thank you, Steve Richter
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.