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



you forget the S for a stand alone field/variable. 

D   OrderNum        S             7A

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im 
Auftrag von Joe D
Gesendet: Freitag, 19. Januar 2007 08:26
An: RPG programming on the AS400 / iSeries
Betreff: Local Variables in a Subprocedure?

Hi All,

Been trying to force myself to use more ILE, even though I am in a RPG/400 
shop.  I also program in Delphi and VB and the concept of procedures, service 
programs, etc really is enticing.

Anyhow.  So tonight I have run into a problem that Google could not help me 
with.

I have a subprocedure that I pass one string and it returns another.  I wanted 
to declare some local variables in the procedure, but when I do the compiler 
acts like the declarations are for the passed in parameters.   The code is 
below.  Only one parm is really being passed in, and I want the other 3 to be 
local.  

How do I declare a local parameter in a subprocedure?

Obviously missing something again,
JD


Code:
     P GetDocType      B
     D GetDocType      PI            50A
     D   Doc                         30A

        // Local Parms
     D   OrderNum                     7A
     D   PickNum                      3S 0
     D   Count                        4S 0

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.