Collapsing large blocks of code? lazarus / 9-Editor ---------------------------------------------------------------------- QEnnay · 2021-08-11 17:39 Hello, Might be asking the impossible here, but I am wrestling hundreds of lines of code. Is there a way to collapse large blocks of code in a single Unit/Form? I have a main-form with a page control and 6-pages, each with hundreds of lines Is there a way I can collapse all of the code for each page as I complete writing it's functionality? I do not want to use "include" files as that gets cumbersome swapping IDE-tabs. I know I could include the sub-procedures within "procedure page_1" and collapse it, but then how do I access those internal procedures outside of the main procedure? From this Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   case pc_main.ActivePageIndex of    0 : page_1;    1 : page_2;  end; // Page_1procedure page_1;beginend procedure page1_stuff_a;beginend; procedure page1_stuff_b;beginend; procedure page1_stuff_c;beginend; // Page_2procedure page_2;beginend procedure page2_stuff_a;beginend; procedure page2_stuff_b;beginend; procedure page2_stuff_c;beginend;   To this Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   case pc_main.ActivePageIndex of    0 : page_1;    1 : page_2;  end; // Page 1--collapsed // Page 2--collapsed ---------------------------------------------------------------------- engkin · 2021-08-11 17:49 Are you familiar with {%region}? If not, check this link {%region /fold}: Quoteif you want the fold to start out collapsed on first loading the file. ---------------------------------------------------------------------- engkin · 2021-08-11 17:55 Also, you might want to know about {$ModeSwitch nestedprocvars} ---------------------------------------------------------------------- QEnnay · 2021-08-11 19:09 Quote from: engkin on August 11, 2021, 07:49:22 pmAre you familiar with {%region}? Nope, I was not, but thanks, that looks exactly what I am after. I had done quite bit of searching before asking here, but did not think  of using "Fold." ETA: Thanks that's perfect ---------------------------------------------------------------------- QEnnay · 2021-08-11 19:13 Quote from: engkin on August 11, 2021, 07:55:30 pmAlso, you might want to know about {$ModeSwitch nestedprocvars} Interesting, but as mentioned I will give the "Region" thing a try.