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