|
Carl, My understanding was that whilst you cannot pass a data structure subfield, or an array element in an *entry plist, you can pass the whole data structure or the entire array. I am sure I have done both in the past. So you should be able to pass the fiscal year in and get either an array or a data structure returned. I do not have a lot of ILE experience, so I just checked the manual to see if this has changed. It seems if you are initialising fields in the called program, it affects whether they can be included its *entry list. I have pasted it in below. I believe that when you pass parameters using the CALL / PARM method, it is not the parameter values that are passed but the pointers to where the values are stored in storage. (hence the unpredictable results with mismatching definitions between caller & called). This would make sense of the restriction on initial values for *entry plist fields. The PARM opcode description in the manual also contains some very useful information about how parameter values are passed. In RPG ILE you can choose to pass parameters by value instead, but I am thinking that you maybe you can only do this if you define prototypes for the call... maybe someone could confirm this. I would also be interested in a recommendation for a good ILE programming book. One that deals with procedures and prototypes, service programs, binding directories and activation groups ! hth Nigel snip from the manual.. The Result-Field entry of a PARM operation cannot contain: o *IN, *INxx, *IN(xx) o A literal o A named constant o A data-area name o A data-area data structure name o A table name In addition, the following are not allowed in the Result-Field entry of a PARM operation in the *ENTRY PLIST: o *OMIT o A globally-initialized data structure o A data structure with initialized subfields o A data structure with a compile time array as a subfield o Fields or data structures defined with the keywords BASED, IMPORT, or EXPORT o An array element o A data-structure subfield o A compile-time array o A program status (PSDS) or file information data structure (INFDS) Carl wrote... >I am developing a program (V4R2) which needs to pass a fiscal year to >another program and return the 12 fiscal period ends which I would like to >define as an array. Since *ENTRY PLIST doesn't allow passing of array >elements or data structures, are there any suggestions as to how I can >implement this without passing 12 PARM fields for the dates and then moving >them to array elements on the return? Also, can anyone recommend a book >that provides some good, complete examples (not snippets) of ILE >programming. Thanks. +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.