× 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: Re: MODS in subprocedures
  • From: boldt@xxxxxxxxxx
  • Date: Wed, 9 May 2001 09:46:51 -0400
  • Importance: Normal



Jon wrote:
> >> I think static is what I was looking for.
>
>I think you just need to code the thing like this - the pointer and
>everything else are not needed.
>
> D resourceDS      ds                  occurs(10) Static
> D  resource                     10
>
>  * Do logic stuff
>
> C                   return    %Addr(resourceDS)
>
>Jon (kicking himself for missing the missing static) Paris

Defining the DS as STATIC within the procedure and returning
the address may well work, but I really wouldn't recommend
that technique.  It gives you one storage area to work with.
What if you need two or more?  Allocating storage outside
the procedure and passing that pointer into the procedure
will offer more flexibility and is less error-prone over the
long run.

Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.