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



"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> wrote on 09/10/2019
11:28:51 AM:
"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> wrote on 09/10/2019
10:30:53 AM:
Personally, I never use SELECT in RPG.
I'm just the opposite... NEVER! use ELSEIF. I absolutely despise
that opcode. ;-)
I dropped SELECT like a hot potato when we got ELSEIF. IMO, SELECT
is just a wasted line.


To each his/her own. ;-) Who cares how many lines of source
code there are? I even include blank lines all over the place for
readability.

I *like* the extra line for SELECT as this provides the perfect
*excuse* for additional grouping/indentation to make things even more
readable. The *extra* line is also perfect for a comment on the whole
section (where ENDSL marks the end of the section). For example:

select; // determine if something actually changed


when iUpdInd.CiCompPTID <> IGNORE_VALUE // if column not
ignored and
and (iUpdInd.CiCompPTID = SET_TO_NULL // indicator to set to
null
or iUpdInd.CiCompPTID = SET_DEFAULT // or to set to
default
or iBefInd.CiCompPTID <> iUpdInd.CiCompPTID // or indicators don't
match
or (iUpdInd.CiCompPTID = USE_VALUE // or set to use value

and pBefData.CiCompPTID <> pUpdData.CiCompPTID)); // and values don't
match
isSuccess = *off; // then signal data was changed

when iUpdInd.ImLfSeqTID <> IGNORE_VALUE // if column not
ignored and
and (iUpdInd.ImLfSeqTID = SET_TO_NULL // indicator to set to
null
or iUpdInd.ImLfSeqTID = SET_DEFAULT // or to set to
default
or iBefInd.ImLfSeqTID <> iUpdInd.ImLfSeqTID // or indicators don't
match
or (iUpdInd.ImLfSeqTID = USE_VALUE // or set to use value

and pBefData.ImLfSeqTID <> pUpdData.ImLfSeqTID)); // and values don't
match
isSuccess = *off; // then signal data was changed

when iUpdInd.BoyExtTtl <> IGNORE_VALUE // if column not
ignored and
and (iUpdInd.BoyExtTtl = SET_TO_NULL // indicator to set to
null
or iUpdInd.BoyExtTtl = SET_DEFAULT // or to set to
default
or iBefInd.BoyExtTtl <> iUpdInd.BoyExtTtl // or indicators don't
match
or (iUpdInd.BoyExtTtl = USE_VALUE // or set to use value

and pBefData.BoyExtTtl <> pUpdData.BoyExtTtl )); // and values don't
match
isSuccess = *off; // then signal data was changed

when iUpdInd.YtdExtTtl <> IGNORE_VALUE // if column not
ignored and
and (iUpdInd.YtdExtTtl = SET_TO_NULL // indicator to set to
null
or iUpdInd.YtdExtTtl = SET_DEFAULT // or to set to
default
or iBefInd.YtdExtTtl <> iUpdInd.YtdExtTtl // or indicators don't
match
or (iUpdInd.YtdExtTtl = USE_VALUE // or set to use value

and pBefData.YtdExtTtl <> pUpdData.YtdExtTtl )); // and values don't
match
isSuccess = *off; // then signal data was changed

when iUpdInd.ExtIdx <> IGNORE_VALUE // if column not
ignored and
and (iUpdInd.ExtIdx = SET_TO_NULL // indicator to set to
null
or iUpdInd.ExtIdx = SET_DEFAULT // or to set to
default
or iBefInd.ExtIdx <> iUpdInd.ExtIdx // or indicators don't
match
or (iUpdInd.ExtIdx = USE_VALUE // or set to use value

and pBefData.ExtIdx <> pUpdData.ExtIdx )); // and values don't
match
isSuccess = *off; // then signal data was changed

when iUpdInd.AbsRto <> IGNORE_VALUE // if column not
ignored and
and (iUpdInd.AbsRto = SET_TO_NULL // indicator to set to
null
or iUpdInd.AbsRto = SET_DEFAULT // or to set to
default
or iBefInd.AbsRto <> iUpdInd.AbsRto // or indicators don't
match
or (iUpdInd.AbsRto = USE_VALUE // or set to use value

and pBefData.AbsRto <> pUpdData.AbsRto )); // and values don't
match
isSuccess = *off; // then signal data was changed

when iUpdInd.TmsLstExt <> IGNORE_VALUE // if column not
ignored and
and (iUpdInd.TmsLstExt = SET_TO_NULL // indicator to set to
null
or iUpdInd.TmsLstExt = SET_DEFAULT // or to set to
default
or iBefInd.TmsLstExt <> iUpdInd.TmsLstExt // or indicators don't
match
or (iUpdInd.TmsLstExt = USE_VALUE // or set to use value

and pBefData.TmsLstExt <> pUpdData.TmsLstExt )); // and values don't
match
isSuccess = *off; // then signal data was changed

when iUpdInd.TmsLstLRl <> IGNORE_VALUE // if column not
ignored and
and (iUpdInd.TmsLstLRl = SET_TO_NULL // indicator to set to
null
or iUpdInd.TmsLstLRl = SET_DEFAULT // or to set to
default
or iBefInd.TmsLstLRl <> iUpdInd.TmsLstLRl // or indicators don't
match
or (iUpdInd.TmsLstLRl = USE_VALUE // or set to use value

and pBefData.TmsLstLRl <> pUpdData.TmsLstLRl )); // and values don't
match
isSuccess = *off; // then signal data was changed

when iUpdInd.TmsLclCmp <> IGNORE_VALUE // if column not
ignored and
and (iUpdInd.TmsLclCmp = SET_TO_NULL // indicator to set to
null
or iUpdInd.TmsLclCmp = SET_DEFAULT // or to set to
default
or iBefInd.TmsLclCmp <> iUpdInd.TmsLclCmp // or indicators don't
match
or (iUpdInd.TmsLclCmp = USE_VALUE // or set to use value

and pBefData.TmsLclCmp <> pUpdData.TmsLclCmp )); // and values don't
match
isSuccess = *off; // then signal data was changed

when iUpdInd.TmsCrpAct <> IGNORE_VALUE // if column not
ignored and
and (iUpdInd.TmsCrpAct = SET_TO_NULL // indicator to set to
null
or iUpdInd.TmsCrpAct = SET_DEFAULT // or to set to
default
or iBefInd.TmsCrpAct <> iUpdInd.TmsCrpAct // or indicators don't
match
or (iUpdInd.TmsCrpAct = USE_VALUE // or set to use value

and pBefData.TmsCrpAct <> pUpdData.TmsCrpAct )); // and values don't
match
isSuccess = *off; // then signal data was changed

when iUpdInd.LifoYn <> IGNORE_VALUE // if column not
ignored and
and (iUpdInd.LifoYn = SET_TO_NULL // indicator to set to
null
or iUpdInd.LifoYn = SET_DEFAULT // or to set to
default
or iBefInd.LifoYn <> iUpdInd.LifoYn // or indicators don't
match
or (iUpdInd.LifoYn = USE_VALUE // or set to use value

and pBefData.LifoYn <> pUpdData.LifoYn )); // and values don't
match
isSuccess = *off; // then signal data was changed

other;
isSuccess = *on; // else signal data not changed

endsl;


Sincerely,

Dave Clark

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.