If XXXX SCAN If YYYYY Do while ZZZZ If AAAAA Line of code 10 EndIf EndDo Else Line of code 1 Line of code 2 Line of code 3 Line of code 4 EndIf EndSCAN Else Line of code 5 Line of code 6 Line of code 7 Line of code 8 Line of code 9 EndifThen it's a lot easier to understand, rather than all over the place as you presented it, where first one has to sort out the indentation and follow the logic before one can decypher and understand the code