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



Hi Paul,

<snip>
Would a %Parms check work with *OMIT? You could use *OMIT on a variable in the middle of the parameter list. Does *OMIT force a null pointer for that parameter?
</snip>

*OMIT passes a null pointer, and will count towards %parms.

I've just written this test code:

    HOPTION(*NODEBUGIO:*SRCSTMT:*SHOWCPY)
    H DFTACTGRP(*NO) ACTGRP('QILE')
     *********************************************************************
    d testProc        pr
    d parm1                          1a   options(*nopass:*omit)
    d parm2                          1a   options(*nopass:*omit)
    d parm3                          1a   options(*nopass:*omit)
    d parm4                          1a   options(*nopass:*omit)
    d parm5                          1a   options(*nopass:*omit)

    d var1            s              1a   inz('A')
    d var2            s              1a   inz('B')
    d var3            s              1a   inz('C')
    d var4            s              1a   inz('D')
    d var5            s              1a   inz('E')
     **********************************************************************
     /free

      testProc(var1 :var2 :var3 :var4 :var5);
      testProc(var1 :var2 :var3 :var4 :*omit);
      testProc(var1 :*omit :var3 :*omit :*omit);
      testProc(var1 :*omit :var3 :var4 :*omit);
      testProc(var1 :var2 :var3 :*omit :var5);
      testProc(var1 :var2 :*omit :var4 :*omit);

      *inLR = *on;
      return;

     /end-free
     **********************************************************************
    p testProc        b
    d testProc        pi
    d parm1                          1a   options(*nopass:*omit)
    d parm2                          1a   options(*nopass:*omit)
    d parm3                          1a   options(*nopass:*omit)
    d parm4                          1a   options(*nopass:*omit)
    d parm5                          1a   options(*nopass:*omit)

    d parms           s             10i 0
     **********************************************************************
     /free

      parms = %parms;
      dsply %char(parms);

      return;

     /end-free
     **********************************************************************
    p testProc        e
     **********************************************************************

In all calls to testProc the value of %parms is 5.

I am coming to the conclusion that using *OMIT and *NOPASS on a parm needs careful consideration. Certainly, using %parms just isn't enough.

Cheers

Larry Ducie



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.