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



Now I am back to wondering why the code was written as it was.

You are correct about the 5 CollTxtn fields being used later in the program. But that raises the question: What programmer would define a data structure in this way? And why? I understand defining an array, or defining 5 fields. I don't understand doing both. What problem(s) could s/he have been trying to solve?

This may seem rhetorical, but I have the feeling I am about to make a change and get unexpected results.




Barbara Morris wrote:
Booth Martin wrote:
In looking at the dates in the program notes, I suspect Shannon has
explained how/why the code is as it is.


CVTRPGSRC wouldn't make a radical change like that.

This OPM RPG multi-occur DS:
IDS1 DS 10 I 1 60 COLTX1 I 61 120 COLTX2 I 301 303 COLCOD converts to this similar DS: D DS1 DS OCCURS(10) D COLTX1 1 60 D COLTX2 61 120 D COLCOD 301 303
Booth, your version with just the array and without the individual names
wouldn't be exactly the same as the original, if the names COLLTXT1,
COLLTXT2 etc are fields from one of the files in your program.  If you
read a file with those 5 COLLTXTn fields, the COLLTXTn subfields of the
data structure would get filled by the read operation, and then they
could be accessed by the array.  If you remove the apparently useless
COLLTXT1-5 fields from the data structure, you would break the
connection between the array and the fields in the file.



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.