|
The routine I am creating will be used by serveral ILE programs. Most of the subprocs I've created dont return lists of information. I am trying to figure which technique would be best for this.
There are 3 techniques:
ORDER_open(12345);
dow (ORDER_read(12345: LineItem) = SUCCESS);
// perform code that operates on one item of // the list returned from the srvpgm
enddo;
ORDER_close();
2) Return an array. For example:
D ORDER_DETAIL DS qualified D based(template) D ItemNo 5P 0 D Desc 25A D Price 7P 2
D Order_load PR 1N D OrderNo 5P 0 value D Array likeds(ORDER_DETAIL) D dim(32767) D options(*varsize) D Max 10I 0 value
D myArray S likeds(ORDER_DETAIL) D dim(100)
/free Order_Load(12345: MyArray: %elem(MyArray));
D Order_load PR 1N D OrderNo 5P 0 value D Callback * procptr value
P Order_Load B export D Order_load PI 1N D OrderNo 5P 0 value D Callback * procptr value
D doCallback PR ExtProc(Callback) D ItemNo 5P 0 const D Desc 25A const D Price 7P 2 const
/free
setll OrderNo ORDDETAIL; reade OrderNo ORDDETAIL;
dow not %eof(ORDDETAIL); doCallback( odItem : odDesc : odPrice ); reade OrderNo ORDDETAIL; enddo;
return SUCCESS;;
/end-free
would call a program and pass back arrays with the information I need. Now with subproc, its appears to be a little different. Thats why I was asking about pointers and arrays. I've seen some API code that used pointers to pass back large amounts of info. If you have a suggestion that doesnt use pointers or arrays, I would love to hear it.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.