General information
Category:
Coding, syntax & commands
>I have 758 lines of code to look at with too many IF's. I am having a hard time trying to follow what each IF construct does. I tried beautify but that does not do the job. Is there any way, like an utility or something that would separate each IF construct?
Are they small or large blocks of code? If they're large (2-3 pages) then 758 lines total is probably only a dozen (or so) structures.
Here's a thought, open the PRG with Excel. (remove all column breaks, so each line fits in a single column, general type, etc.) Then use the Data/Group&Outline to group the if..else..endifs into manageable blocks. (select some rows, use DATA/G&O/Group) Once you've done the work (sorry, it IS work) of setting up the excel view of your program, you can expand/collapse the code-blocks as a visual map to see what's going on. (using the top-down approach, you could collapse everything but the outermost structure, then work your way in when you understand each block)
Or maybe a less productive method, but satisfying on other levels, would be to hunt down the maniac who left this mess without any comments! (you have already informed management that once you straighten this out you're taking a vacation day, right?)
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only