Project

General

Profile

TH3-Code Collapse » History » Version 3

Version 2 (Wil van Antwerpen, 05/18/2019 10:20 PM) → Version 3/5 (Wil van Antwerpen, 06/01/2019 10:53 PM)

# Code Collapse

The Hammer 3.0 is based on the scintilla control and as such it wasn't too hard to add code collapse specifically for the DataFlex language.
This is one of those features that you don't miss until you actually have it.
##How How does it work?

You get to see a (-) symbol in front of the line of code that can be collapsed.
If you click that (-) symbol it will collapse a block of code into one line and the symbol will change into a (+) symbol.

Currently the following scope keywords automatically support the code collapse feature:

* begin / end code blocks
* object / end_object
* class / end_class
* procedure / end_procedure
* function / end_function
* while / loop
* case begin / case end
* type / end_type
* struct / end_struct
* #COMMAND / #ENDCOMMAND
* comments (1)
* section metatags (see below)

## comments

If you have multiple lines of comments then you can collapse those lines to one line by clicking on the (+) symbol in front of the line.

## section metatags

If you want to be able to collapse a whole bunch of code so that you can quickly hide specific parts of code then use the section metatag collapse feature.

It works as follows:

~~~
{ #CodeSection YourSection }
.... your code
{ #CodeSection YourSection }
~~~

This then looks as follows:

<insert screenshot here>

## compiler listfiles

This one is pretty useful and not one you would think of immediately.

If you have a .prn/.prp file then you actually have code collapse in there as well (was broken, just fixed 2019-05-17)

It can really be a drag having to plough through all that code. Being able to use code collapse in here does help quite a bit.