Compiler directives: #region


#region[-] [name]
[#endregion [comments]]



name, comments - can be any text. Optional.

statements - any statements.



- Don't nest this block in previous #region block. Adding this option is the same as inserting #endregion line before.



Lets you specify a block of code that you can expand or collapse (hide, fold) in the code editor. Can be used in QM items of all types (macros, menus etc).


QM uses this directive only when displaying code in the code editor. When compiling macro or creating menu etc, #region and #endregion lines are ignored, like comments.


When first time displaying a #region line, QM adds a vertical bar with - and + boxes to collapse/expand regions. You also can use its right-click menu to collapse or expand all regions or create new region. Also you can use menu 'Edit -> Lines -> Hide selected' to create new region.


Added in QM 2.4.1.