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



Marco,
This is why you shouldn't specify both real code/data in a /COPY as well as
the prototype. The only "data" that should be defined in your /COPY members
are Data Structure Templates, variables to be imported, and named constants.
There was, and apparently still is, a technique floating around that
advocates placing everything (implementation and prototypes) in one source
member and then using directives to tell the compiler which one you wanted.
This technique should be considered nothing more than theoretical babble.
Meaning, using it should be placed in the same category as pointing a loaded
gun at your foot and pulling the trigger. Sure you can do it, but why do you
want to?
I've been programming with C and C++ since about 1992 or 1993 and C
programmers have always used their equivalent of /COPY to store prototypes
and such. In all that time, I have never seen anyone use a technique that
incorporates the implementation and prototype into one source member; well,
that is, never seen it used outside the first day of and Intro to C
programming class.

Of course if this isn't the situation for your code, then never mind. 

-Bob Cozzi
www.RPGxTools.com
If everything is under control, you are going too slow.
- Mario Andretti

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Marco Facchinetti
Sent: Tuesday, May 10, 2005 2:46 AM
To: RPG programming on the AS400 / iSeries
Subject: A bug?

I made a service program with this prototype:

 /IF NOT DEFINED(SERVICE)
d xnamfields                    10    dim(500)
d xposfields                     5i 0 dim(500)
d xlenfields                     5i 0 dim(500)
d xnbrfields                    10i 0 inz
 /ENDIF
d mgetfields      pr            10i 0 extproc('MGETFIELDS')

d xnomefile                     10    const
d xnomelibr                     10    const
d xnamfields                    10    dim(500)
options(*OMIT:*NOPASS)
d xposfields                     5i 0 dim(500)
options(*OMIT:*NOPASS)
d xlenfields                     5i 0 dim(500)
options(*OMIT:*NOPASS)

and the RPG compiler didn't notice that I forgot the S in
the field definitions between the IF DEFINED and ENDIF, the
RPG/SQL compiler spotted the error.

Marco


                
__________________________________ 
Yahoo! Mail Mobile 
Take Yahoo! Mail with you! Check email on your mobile phone. 
http://mobile.yahoo.com/learn/mail 
-- 
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.