|
I'm experimenting with EXPORTED DataStructures and I found I don't know how to properly do that. MODUL A is eporting DS and modul B is importing. There are two versions of modul B. One is working as I expected and another is working but obviosly DS structure is not resolved during bind time... I need opinion about examples listed down: MODUL_A (provides subProcedures for handling transactions AND an exported DS that represents current transaction) ------------------------------------------------------------ /COPY PROTOS...... D transaction DS D VALUEDATE D D POSTIDATE D D TEXTTRANSAKC 30A D AMOUNT1 15 0 D AMOUNT2 15 0 D transakcija DS LIKEDS(transaction) EXPORT // subrotines for handling transakcija DS (not important) MODUL_B NON WORKING VERSION (cycles throught prepared transactions but IMPORTED structure isn't resolved) ------------------------------------------------------------ /COPY PROTOS...... D transaction DS D VALUEDATE D D POSTIDATE D D TEXTTRANSAKC 30A D AMOUNT1 15 0 D AMOUNT2 15 0 D trans DS IMPORT('TRANSAKCIJA') /free prepareTransactions(subKey:d'2005-01-01':d'2005-12-31'); DOW nextTransaction; // This line DISPLAYS only first CHAR of DS // If I reference trans.OPISTRANSAKC I'm getting COMPILE ERROR DSPLY trans; ENDDO; *inlr=*ON; return; /end-free MODUL_B WORKING VERSION (cycles throught prepared transactions and IMPORTED structure subfields are OK) ------------------------------------------------------------ /COPY PROTOS...... D transaction DS D VALUEDATE D D POSTIDATE D D TEXTTRANSAKC 30A D AMOUNT1 15 0 D AMOUNT2 15 0 D trans DS IMPORT('TRANSAKCIJA') D trans2 DS LIKEDS(transaction) D BASED(trans2ADR) /free trans2ADR=%ADDR(trans); prepareTransactions(subKey:d'2005-01-01':d'2005-12-31'); DOW nextTransaction; DSPLY trans2.OPISTRANSAKC; ENDDO; *inlr=*ON; return; /end-free Do anybody have a simple working example of using IMPORTED datastructure. My working module is OK but I believe there is simplier way to achieve that than using pointers. Thanks! dipl.ing. Igor Bešlić, IBM Certified Specialist ILE RPG Programmer VOLKSBANK d.d. OJ Informatika Varšavska 9, 10000 Zagreb tel: +385 1 4801 895
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.