Name the Indicators - Tip2
Page 1 of 1
Name the Indicators - Tip2
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.
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.
Similar topics
» Improve the performance of the RPG program – Tip2
» indicators in rpg/400
» Name the Indicators - Tip1
» Name the Indicators - Tip3
» Name the Indicators - Tip4
» indicators in rpg/400
» Name the Indicators - Tip1
» Name the Indicators - Tip3
» Name the Indicators - Tip4
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum