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



R. Bruce,

>Fool me once, shame on you, fool me twice, shame on me.

I think that's the bottom line. <g>

>YET, for some damn reason, the compiler writers, still to this day, assume
>that they know better than us when it comes to declaring a variable.

>Since when (yeah, I know, it's historical) is it acceptable that a compiler
>change the EXPLICIT INTENT of the programmer writing the code.

Aside from being historical and maintaining backward compatibility, it will
likely always continue to work this way simply because RPG allows you to use the
same field name in multiple files, and they all map to the same variable within
RPG.

You see, you did *not* explicitly show an intent for the RPG field to be zoned
-- you showed an intent for the *display file* field to be zoned.  Packed fields
really don't work very well with the 5250 data stream, or with users... <g>

Forget display files for the moment.  Let's say you had two database files
containing a customer number.  In one the field was declared as packed, and the
other zoned.  But each used the same field name.

What should the compiler think is your EXPLICIT INTENT?  When either file is
read, the same RPG variable must be modified.  Should the field be zoned or
packed?  You can't have it both ways.

Unless you use an externally described data structure, the zoned/packed choice
of an external file (display or database) has no bearing on the program's
internal storage format.  It has always been that way, and likely will continue
to be that way for time immortal.  In RPG II, the internal representation would
be zoned; in RPG III it would be packed.  In RPG IV, in the absence of a D spec
to state a preference, it would also be packed.

>Since when is
>it a good idea to declare the same damn variable twice, in two different
>sources, just to have the variable retain it's original declaration?

Since when?  Since the beginning of RPG. <g>

>If fixed column formating is "old" and "outdated" why then is changing the
>explicit intent of the programmer so that RPG can store numbers in packed
>decimal just so that the 38 processor can be more efficient, still an
>acceptable practice today on PPC chips?

Because it is not "just so that the 39 processor can be more efficient".  It is
because RPG doesn't use qualified names for fields from files, and thus the same
fields name can have multiple "explicit intents".

Doug


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.