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



 >> The code has several arrays utilizing compile-time data.  Module
creation fails stating that the use of CTDATA is not allowed in a
subprocedure.

Not to discourage you from subprocedures, which are wonderful, but you could
have turned this into a bindable procedure simply by compiling with
CRTRPGMOD and calling it with CALLP.

That said - if you want to keep compile time arrays and use them from the
subproc(s) then the answer is simply to place them in the Global portion of
the source.  So your source sequence is like so:

 H spec
 F specs
 D specs for compile time arrays i.e. Global data
 P spec to start subproc
 D spec for procedure interface
 D specs for local data
 C specs for subproc
 P spec to end subproc
 ** compile time data

This example compiles just fine:

     H NoMain
     D Proc            Pr
     D Array           S              4    CtData PerRcd(1) Dim(2)
     P Proc            B
     D                 PI
     C                   Eval      Array(1) = 'X'
     C                   return
     P Proc            E

**CtData Array
abcd
efgh


Jon Paris
Partner400



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.