I think I'd vote for it, as well.

On 1/28/2019 8:04 AM, Justin Taylor wrote:
I haven't used SELECT since ELSEIF. Mark, you could always open an RFE. I'd vote for it.

-----Original Message-----
From: Jon Paris [mailto:jon.paris@xxxxxxxxxxxxxx]
Sent: Friday, January 25, 2019 3:34 PM
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: select vs. if-elseif

You are correct - there is effective redundancy there and sadly it probably can't be changed.

Personally I always found the old RPG SELECT to be confusing because my mental model has Select meaning "choose from a list of possibilities" - in other words what your suggestion appears to be doing.

I welcomed the arrival of ElseIf because it gave me a different syntax that I could map into my model.

So my rule is use ElseIf in cases where the condition can change and use Select when picking from a list of possible values.

Been much happier since I did that.

Jon Paris


On Jan 25, 2019, at 4:01 PM, Mark Murphy <jmarkmurphy@xxxxxxxxx> wrote:

Does anyone else find the redundancy between the select block and the
if-elseif-else block a little disconcerting? Seems to me that there
should be a clear distinction between the two. There never can be at
this point, so I tend to use a relatively inconsistent mix of the two
in my code based on what mood I am in. But the select syntax has a
potentially game changing syntax.

select <variable>;
when <value>;
when <value>;
when <value>;

This syntax reduces redundancy in a significant amount of code, by
reducing the need to retype code variable names over and over again.
Wouldn't it be nice?
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email:
RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 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].