E
egarcia
Guest
This question reminded me of a similar scenario that happens in JavaScript. In JavaScript, JSLint would return message "Move all 'var' declarations to the top of the function" or "Don't declare variables in a loop". I personally would use this same approach for ABL (since it has a similar scope behavior). Even though this would be a style preference, it is important that a program can clearly show the scope and what it is doing. (Using a command line parameter option to enable functionality would means that you would need to know the option for reading the code.) For example, consider the following program. How many times is the DISPLAY statement executed? DEFINE VARIABLE i AS INTEGER NO-UNDO. REPEAT i = 1 TO 2: DEFINE VARIABLE j AS INTEGER INITIAL 0 NO-UNDO. REPEAT WHILE j < 5: j = j + 1. DISPLAY i j. END. END. (Of course, there are different ways that the code could be written to make it clearer.)
Continue reading...
Continue reading...