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



Vern, I recall that bit of conversation in this list, but I didn't give it
much thought at the time. But it seems to me that if this is true that this
would be disturbing behavior. If the fields for an externally defined file
defined in the program F specs do not come into the program in the record
layout as defined in the database then this would/could be a problem. If
the record layout does not guide the compiler in the field order then what
does? Are there rules to determine the sequence of the fields? ... If there
are no rules then the field layout could change from compile to compile.


Paul

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Vernon Hamberg
Sent: Tuesday, January 21, 2014 5:19 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: overlaying arrays in v5r1

Hi Ken

I've used this same technique in the past, probably without problems.
Bit I think I've been told (maybe Jon Paris) that this technique is not
guaranteed to be safe. There is no guarantee that contiguous fields will be
brought into the program buffers in the same order - each field is brought
into internal buffers individually - unless using LIKEREC or EXTNAME.

Now maybe we could use a pointer to the subfield in the LIKEREC DS as the
based pointer of the stand-alone array - then it wouldn't matter, so long as
the fields in question remain contiguous in the format.

Whadda y'all think?
Vern

On 1/20/2014 8:41 PM, Ken Sims wrote:
Hi Tom -

On Mon, 20 Jan 2014 15:17:33 -0600, Thomas Garvey <tgarvey@xxxxxxxxxx>
wrote:

Since I needed to use the externally described data structure, which
brings in the original fields as subfields, I could not create
separate data structures to name the subfields again and have them
overlaid (which I would LIKE to do to avoid the
overlay(field:startpos) format of the overlay keyword).
So, I did use the StartPos format. Fortunately, the file this is
based on is mature and won't be changing.
What I've done when the field are contiguous in the record format, and
that aspect will NOT change, however there could be fields added or
changed such that the absolute position in the record format could
change ...

... is to code the array stand-alone, based on a pointer, and have the
pointer defined to initialize to the address of the first of the
fields in the record format.

Ken
Opinions expressed are my own and do not necessarily represent the
views of my employer or anyone in their right mind.

--
This is the RPG programming on the IBM i (AS/400 and 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.