× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: API Receiver Variable Size Optimization
  • From: "David Keck" <dkeck@xxxxxxx>
  • Date: Thu, 18 May 2000 00:14:32 -0700

The System API Programming manual for V4R1 suggests a technique for optimizing storage allocation when establishing receiver variable sizes as shown at the following address ... http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/QB3AVC00/2.7.1
The following is an extract from that page of the manual ...
---QUOTE-----------------------------------------------------------------
Depending on the capabilities of your high-level language, some API users take advantage of the following technique to avoid guessing the appropriate size for the receiver variable:

  1. Call the API with a receiver variable length of 8 bytes (that is, just enough for the bytes available and the bytes returned fields).
  2. Dynamically allocate an amount of storage equivalent to the bytes available.
  3. Set the length of receiver variable parameter to the amount of storage allocated.
  4. Pass the address of the storage allocated in step 2 by using pass by value (directly).
This technique provides for highly flexible use of APIs that can return variable amounts of data.
----END QUOTE ----------------------------------------------------------------
Step one is clear enough, however, steps 2,3,4 are not.  Is this technique applicable to RPG/IV ?  If not then what ?

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.