5 pts.
 Indicators in AS400
I have the code;

50  leave

N50 xxxxxxx

where 50 is the indicator. If 50 sets on, then executes leave operation.

What is use of N50?



Software/Hardware used:
As400
ASKED: January 27, 2010  4:00 PM
UPDATED: January 28, 2010  4:41 PM

Answer Wiki:
In the described case 'N50' can be left out. Maybe this coe is clearer to understand:<pre>if *in50; leave; else; ... endif;</pre> =================================================== Logically, there is no point to having N50 on the line. The line should never be reached unless 50 is off, so there is no logical reason for having the N50. ("N50" means indicator 50 is "not" on.) It is possible that the N50 line was in the program from the beginning, and the 50 line was added later. When the 50 line was added, the programmer could have removed "N50" but forgot to do so or chose not to make changes that weren't absolutely required. Or the programmer was simply unsure how indicators worked. Regardless, when the 50 line LEAVEs the block of code, the N50 condition doesn't have to be specified. Tom
Last Wiki Answer Submitted:  January 27, 2010  11:13 pm  by  DanTheDane   2,555 pts.
All Answer Wiki Contributors:  DanTheDane   2,555 pts. , Littlepd   1,130 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

some programmers put in the redundant N50 as a sort of documentation …

 405 pts.

 

That is what comment lines are for.

 475 pts.