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



IMO, there are too many good coding techniques available using v5 rpg to
spend time developing coding standards that bridge v4 and v5 rpg. I
understand the need to provide good code to customers on v4, but I dont
think it is doable without harming customers who run v5.

You have to get a laugh at the hypocracy of IBM however.  On the one hand
they say that RPG is dead, but on the other, they are using the promise of
more productive rpg coding techniques to incentivize customers into paying
to upgrade from V4 to V5.

I wish the people who work at IBM would show some mercy towards those who
write rpg code that has to run on both V4 and V5. V5 rpg has to be ptf'able
back to V4 os400.

-Steve Richter


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Joe Pluta
Sent: Wednesday, August 13, 2003 10:52 AM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: Prototypes, /COPY and LIKE()


> From: Barbara Morris
>
> Joe, that's a good and standard technique, to use
> based(always_the_same_namee) for anything that's only to be used as a
> "type" definition.  The compiler won't allow __ as a name, though.
>
> For the prefix, you might want to use the name of the structure, to
> avoid name collisions.

Thanks Steve, Scott and Barbara.  Since qualified won't compile back to
V4R5, I'm going to stick with the prefix for the short term.  However, I
need to make a decision on using the file name as the prefix, or a
generic prefix.  In my architecture, all database fields have unique
names.  Some people argue that if two fields share the same data, they
should have the same name, but in practice I've found that this
occasionally leads to unexpected results, since in RPG all database
fields are global.

Thus, since my names are all unique, I don't have to worry about
collisions between multiple reference structures, provided there is only
one structure per program.  I enforce that by having only one I/O module
per file.  All I/O is done through that module, and I would define the
reference DS in the same /COPY as the module's external prototypes.

Looking back on what I wrote, however, I see that by adding a
file-specific prefix I avoid any possible conflicts.  I still need to be
sure to only define the reference DS once, but that would be handled by
the "one I/O module per program".

Now, however, a new conflict comes into play.  In this situation, I have
a NON-I/O procedure that requires a field from a database.  Maybe it's a
formatting thing, or some other sort of business logic.  It doesn't
technically belong in the I/O module (for example, it may require fields
from multiple files).  If I were to use the technique as defined to this
point, I'd have conflicts if I had both the I/O module and the
formatting module in the same program.

So perhaps the idea is to use the MODULE name as the prefix.  That way,
I'd never have conflicts.

What do you think?

Joe


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

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.