PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).

Join the forum, it's quick and easy

PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).
PMS Information Systems
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Name the Indicators - Tip2

Go down

Name the Indicators - Tip2 Empty Name the Indicators - Tip2

Post  maran Thu Feb 09, 2012 12:05 pm

RPG understands indicators. We don't need to spell everything out

Right from its inception, RPG has understood indicators to be boolean variables that simply equate to true or false. So If *In25 = '1'; is not only ugly--it is a waste of typing because the shorter and, to me at least, more obvious If *In25; is identical in effect.


If validAccount;

Or even:

If *In(validAccount_25);

Are a lot easier to understand then:

If validAccount = '1';

The increased readability shines though when WE consider the negative condition. For example consider how much more obvious:

If Not validAccount;

Is when compared with:

If validAccount = '0';

Perhaps WE never use '1' but use the figurative constants *On and *Off? Isn't that better?

Not a lot really. Although most of us have grown up thinking of indicators as being "On" or "Off", that is a just throwback to the tabulator origins of RPG, where indicators were real physical switches that could indeed be on or off.

maran
maran
Admin

Posts : 442
Join date : 2009-07-24

https://pmsinformationsystem.forumotion.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum