× 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.



Lim Hock-Chai wrote:

If CEEDOD is a slow polk then is there a point of using
options(*varsize) on const?

If you use options(*varsize), you must call CEEDOD to see how much of
the parameter you can use.  (Unless the caller passed another parameter
giving the length.)

Someone else suggested using VARYING instead of options(*varsize). 
That's a good idea, because you wouldn't have to call CEEDOD, and the
cost of copying the parameter to your temporary would depend on the
length of the parameter.

       p example         B                   export
       d                 pi            10i 0 opdesc
       d  piParm1                   32767    const varying
       d                                     options(*nopass:*omit)
       d  piParm2                   32767    const varying
       d                                     options(*nopass:*omit)
 
       d  myParm1        s                   like(piParm1) 
       d                                     inz(defaultvalue)
        /free

         if (%parms >= 1 and %Addr(piParm1) <> *Null);
           myParm1 = piParm1;
         endif;        

If you define myParm1 as static, to avoid having the automatic variable
allocated on every call, do it like this.

       d  myParm1        s                   like(piParm1) 
        /free

         if (%parms >= 1 and %Addr(piParm1) <> *Null);
           myParm1 = piParm1;
         else;
           myParm1 = defaultvalue;
         endif;


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.