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



John,

I agree with you, that the way the compiler compares varying-length strings
works well for most programmers and it is close to how it does it for
fixed-length strings.

I never stumbles about string compare before I saw that Java generic string
compare method.

You cannot see air. But certainly it is different from vacuum. But not for
the RPG compiler. ;-)

Regards,

Thomas.

Am 27.03.2015 um 15:09 schrieb John Yeung:
On Fri, Mar 27, 2015 at 9:06 AM, Ken Sims <mdrg8066@xxxxxxxxxxx> wrote:
On Fri, 27 Mar 2015 10:19:23 +0000, Thomas Raddatz
<thomas.raddatz@xxxxxx> wrote:
It does not explicitly mention varying fields and I completely agree for fix-length fields. But for varying fields, for example, a field with length = 0 is different from a field with one or more spaces.

What is your opinion about that?

My opinion is that it is working as designed.

There's no question it's working as designed. The only question is
whether that's a flawed design.

If the compiler was coded so that varying fields had to be
the same length to be considered equal, then people who didn't care
about the length being equal would have to move the varying fields to
fixed length fields to do a comparison. The way it is now is more
programmer-friendly.

The way it is now is only more programmer-friendly from the point of
view of someone who wants it to be the way it is.

To anyone who is expecting and wanting what Thomas wants, it is very
decidedly NOT more programmer-friendly. (You even demonstrated
yourself that to achieve what he wants to achieve, he has to throw in
more code.)

My opinion is that the way most other languages do strings is better
than the way RPG does strings. But that's my preference. Given RPG's
roots, I think that the way RPG handles varying-length strings is
actually quite reasonable. It's "backward compatible-ish" while
providing some additional benefits. It just fits better into RPG to
do it the way they've done it, I think.

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.