Code folding provides the facility to collapse sections to code to a single line giving you more screen area to work on a different section of code.  There are two types of code folding, Context Code Folding and User Defined code folding.

Context Code Folding

Context Code folding will automatically add code folding regions to recognised code constructs such as For Next, If, EndIf etc..  These folding regions will appear automatically on opening a source file or when adding code having the recognised construct.

On opening the file or entering a recognised code construct the code folding region will be expanded.  Click on the symbol in the left hand gutter to fold the region.  Conversely, click on the symbol to show the whole contents of the folded region.

In the applications Main Tool Bar click on the expand and collapse code folding buttons to expand or collapse all Code Folding regions.

Context Folding recognises the following Basic constructs:

Tests

$If..$EndIf, Select..EndSelect

Loops

For..Next, Repeat..Until, Do..Loop, While..Wend, For..Next

Calls

Sub..EndSub, Proc..EndProc, ISR..EndISR

Note - Code folding is not available for If, EndIf statements as the syntax for these statements is not consistent.

User Defined Code Folding

You can choose to select a section of code to fold by specifically marking it for code folding.

Select the section of code to fold/unfold. In the applications Main Tool Bar:

Click on Add Code Folding Region.  All lines selected will be wrapped in the code folding indicator on the left hand gutter.

Click on Remove Code Folding Region to remove code folding on the selected code. 

Note - If you want User Defined Code folding to be recalled when re-opening the document you must have Save Meta Data checked in Options, General, tab.