|
Thank you for bearing with me. The other person explained it quite well. You correctly used the offset to the list size, the length of the list size, etc from the general header area. Then you moved this data into a data structure of a smaller length. And even if you use standard data structures from the QSYSINC library you can get 'bitten'. You pack too many bytes into a short data structure and therefore other variables get clobbered. So basically you need to move either the %len(of the data structure) or the len of the list size (as determined by the general header area) : whichever is shorter. I would avoid QUSRTVUS and use pointers. Believe me, I was very pointer phobic. However the readability of the code was much clearer to understand. I even convinced some extremely pointer phobic people that the code is much clearer. See section 5.3.2, page 159 of the 'Who knew...' book. But I will grant you this, QUSRTVUS might be an appropriate choice for someone mass marketing a tool. Why? Because someone may have their system pretty tight and declared all libraries part of the system-domain instead of user-domain. You can't use pointers in a library in the system-domain. But, in general, most of my user space output is in QTEMP, so I don't give a rip. Rob Berendt ================== A smart person learns from their mistakes, but a wise person learns from OTHER peoples mistakes. David Gibbs <dgibbs@mks.com> To: "'RPG400 Mailing List'" <RPG400-L@midrange.com> Sent by: cc: owner-rpg400-l@mi Subject: RE: Resolution to my MCH3601 problem drange.com 05/31/01 07:44 AM Please respond to RPG400-L > Many people use list API's incorrectly. Instead of using the general > header area, and header entries, which contain offsets to > where other data > elements are stored. Often they calculate the offset > manually. This way > they'll be defeated when new offsets occur. Might this be what you've > done? No, actually .. it was the length that screwed me up. My buffer was only 508 bytes long, but the new API returned 3995 bytes. I didn't realize the buffer size had changed. When I changed the QUSRTVUS call to only give me 508 bytes, it worked exactly as I expected. david -- David Gibbs Sr. Software Engineer Mortice Kern Systems US, Inc. 2500 S. Highland Ave., Suite 200 Lombard, IL 60148 phone: (630) 495-2108 x5004 http://www.mks.com mailto:dgibbs@mks.com Need a laugh: http://www.userfriendly.org/static +--- | 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 +--- +--- | 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.