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



On Sat, Feb 23, 2013 at 10:11 AM, Ken Sims <mdrg8066@xxxxxxxxxxx> wrote:
It's not a bug. In RPG, since the beginning it's been part of the
specification for varying fields that everything beyond the defined
length is unknown. If a program is coded in such a way as to care
what's there, the bug is in the user's code, not in the compiler.

I completely agree. In case people have forgotten or not followed the
thread, someone was using a varying length field in a data structure,
and attempting to use that structure to test for equality.

I don't think that's the way to even think about data structures. RPG
is not THAT high-level a language. An RPG data structure is not an
object with arbitrary attributes. It's not a collection of arbitrary
values. It's just a C struct. It's a chunk of memory that you can
overlay some definitions onto. So if you put a varying field into a
DS, you have to be aware that the definition of a varying field
includes memory allocated for the maximum length, and that the
contents of the memory between the current length and the maximum
length is *explicitly* undefined. In other words, it's junk.

I think varying fields inside data structures is a bad idea. It's
mixing two different levels of abstraction into one horrible, stinking
mess.

John

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.