Ian Branch 127 Posted December 1, 2021 Hi Team, Is there some way or a tool that can/will collapse defines in the IDE? i.e. {$IF defined(xxx) or defined(yyyy)}.....{$ENDIF} and {$IFDEF xxxx}.....{$ENDIF} I have a large unit with multiple defines used by multiple apps, and it is sometimes difficult to be sure that I am not duplicating or adding defines where they don't need to be or shouldn't be. Regards & TIA, Ian Share this post Link to post
angusj 126 Posted December 1, 2021 Have you considered using an include? Share this post Link to post
Ian Branch 127 Posted December 2, 2021 Not at this stage. The unit has grown over time/years and needs to be rationalised. The trouble is identifying the relevant/individual conditionals. I found one piece of code where the entire procedure between begin & end was covered by a conditional conditional and then within it I found a repeat of the same conditional. Hence the desire to collapse the conditional so I can readily see what is in what. Share this post Link to post
angusj 126 Posted December 2, 2021 (edited) Sorry, I misread your OP. I thought you were trying to hide the define statements themselves, not the code inside these conditions. Edited December 2, 2021 by angusj Share this post Link to post
corneliusdavid 214 Posted December 2, 2021 Well, you could put the code you want collapsed in a {$REGION} because regions are collapsible. But that's a lot of extra work--and more lines of code. Share this post Link to post
Stano 143 Posted December 2, 2021 Try running the unit through Pascal Analyzer Lite. It is quite likely that he will explain something to you. Share this post Link to post