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



This is an interesting problem, and I don't know why it's causing an error,
but I can think of a kludge to work around it.

Instead of returning an array return a buffer of 11 x 12 = 132 bytes, and
use an overlay for your sales.  If this is a problem that needs an immediate
solution, that is probably what I would do, until I found out why returning
an array wasn't working.

I don't see anything wrong with the code, unless RPG doesn't like returning
arrays as parameters.

Good luck.

Regards,

Jim Langston

-----Original Message-----
From: MWalter@hanoverwire.com [mailto:MWalter@hanoverwire.com]

Hello all,

I am having fits with a routine that is getting a 'pointer not referenced'
error when trying to return an array. Both are RPGIV. The call is
prototyped. If I look at the procedure in debug, it works fine until the
return statement then it fails. Here is the siginficant code:

/* Main program */
     Dsales            s             11  3 DIM(12)
     DgetPlanedSales   PR            11  3 DIM(12)
     D                               15    CONST
     D                                4  0 CONST
     D                                3  0 CONST

      * planned Sales selection
     c                   eval      sales =
getPlanedSales(itnbr:slsPlnYr:seq#)

/* subProcedure */
     H noMain
     fSls600wfl if   e           k Disk    usropn

     d                 DS
     DdsPlan                   1    120  3 DIM(12)
     D fcstum1                 1     10  3 INZ
     D fcstum2                11     20  3 INZ
     D fcstum3                21     30  3 INZ
     D fcstum4                31     40  3 INZ
     D fcstum5                41     50  3 INZ
     D fcstum6                51     60  3 INZ
     D fcstum7                61     70  3 INZ
     D fcstum8                71     80  3 INZ
     D fcstum9                81     90  3 INZ
     D fcstum10               91    100  3 INZ
     D fcstum11              101    110  3 INZ
     D fcstum12              111    120  3 INZ

     DgetPlanedSales   PR            11  3 dim(12)
     D itnbr                         15    CONST
     D year                           4  0 CONST
     D seq                            3  0 CONST

     PgetPlanedSales   b                   export
     DgetPlanedSales   PI            11  3 dim(12)
     D itnbr                         15    CONST
     D year                           4  0 CONST
     D seq                            3  0 CONST

     dplan             S             11  3 DIM(12)
     dx                s              2  0
     DseqKey           S              2  0

     c                   if        not %open(Sls600wfl)
     c                   open      sls600wfl
     c                   endif

     C     key           klist
     c                   kfld                    year
     c                   kfld                    seqKey
     c                   kfld                    itnbr

     c                   reset                   plan
     c                   eval      seqKey = seq

     c     key           setll     Sls600wfl
     c                   dou       %eof(Sls600wfl)
     c     key           reade     Sls600wfl
     c                   if        %eof(Sls600wfl)
     c                   leave
     c                   endif

     c                   for       x = 1 to 12
     c                   eval      plan(x) = plan(x) + dsPlan(x)
     c                   endfor

     c                   enddo

     c                   return    plan

     P                 E


Thanks in advance,

Mark


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.