|
> > If you're really worried about it, then the ALLOC approach that you > suggested is the way to go. Here's how you implement that approach: > > 1) Note that in the API documentation under "Length of > Receiver Variable" > it tells you that the receiver variable's minimum size is 8 > bytes. What > that means is that it's perfectly legal to pass a receiver > variable that > looks like this: > > D Needed ds > D BytesRtn 10I 0 > D BytesAvl 10I 0 > > 2) Call the API with that 8-byte data structure above as your receiver > variable. The "BytesAvl" member will tell you EXACTLY how > big of a buffer > you need. > > 3) Allocate the buffer with pointer = %alloc(BytesAvl) > > 4) Have a second data structure, this one will use the BASED > keyword to > put it into the memory that you allocated to the pointer. The data > structure itself can be any size you like, since the amount of memory > allocated is unrelated to the size of the data structure itself. > Obviously, it'll have to be at least long enough to get the > offset to the > libl, and the number of entries in it. > > 5) After you've read the library list, DEALLOC the pointer, and don't > refer to the contents of the data structure again. > > This approach should guarantee that you get all of the entries in the > library list... the next question is, what are you going to > do with them? Scott, Thanks for your help. This is exactly what I was thinking about. Just didn't realize the implications of the "Bytes Availiable". All I'm doing with the LIBL returned is passing it to the Chang Library List API (QLICHGLL). The program I'm writing is supposed to set a job's current library list using the initial library list of a JOBD. Just in case you're wondering. This program will be used in another whose purpose is to set our developer's library lists correctly for testing with respect to the Aldon CMS library configuration. Thanks again, Charles
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.