ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Editors / Code editor
  • Overview
  • How to?
  • Collapsing an existing code
  • Expanding a code
  • Defining a set of lines of code to collapse/expand
  • Declaring a custom code block
  • Limits
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
The code is collapsed to improve readability, by only displaying the comments in front of the lines of code.
You can collapse a code that is already known and checked.
Collapsing this code is used to free space in the code editor. The code becomes clearer and more readable.
Several types of lines of code can be collapsed:
  • the lines of code corresponding to a specific code structure: the conditional statements (IF, CASE, WHEN EXCEPTION), the declarations of global variables, constants, structures, ...
  • the lines of code preceded by a comment.
  • the specific lines of code, defined by the developer.
  • the lines of code corresponding to a multiline string.
  • the lines of code of a process.
You can also declare custom code blocks to collapse.
No code is collapsed by default.
Example of expanded code:
Example of collapsed code:
How to?

Collapsing an existing code

A code that can be collapsed is preceded by the "-" sign.
To collapse an existing code, you can:
  • click the "-" icon found in front of the statement. Only the comment line preceding the statement will remain visible.
  • display the popup menu of the "-" icon and select "Collapse".
You can also:
  1. Move the edit cursor into the code to collapse.
  2. Use one of the following methods:
    • on the "Display" tab, in the "Collapsible code" group, expand "Collapse" and select "Collapse".
    • press Ctrl + the "-" key on the numeric keypad
When a collapsed code is hovered by the mouse cursor, a tooltip displays a section of the collapsed code.
Remark: To collapse all collapsible lines of code in the current process, on the "Display" tab, in the "Collapsible code" group, expand "Collapse" and select "Collapse all".

Expanding a code

A code that can be expanded is preceded by the "+" sign.
To expand a code, you can:
  • click the "+" icon found in front of the code to expand.
  • display the popup menu of the "+" icon and select "Expand".
You can also:
  1. Move the edit cursor into the code to expand.
  2. Use one of the following methods:
    • on the "Display" tab, in the "Collapsible code" group, expand "Collapse" and select "Expand".
    • press Ctrl + the "+" key on the numeric keypad
Remark: To expand all the collapsed lines of code in the current process, on the "Display" tab, in the "Collapsible code" group, expand "Collapse" and select "Expand all".

Defining a set of lines of code to collapse/expand

To specifically define the lines of code to collapse/expand:
  1. In the code editor, select the different lines of code that can be collapsed/expanded.
  2. On the "Display" tab, in the "Collapsible code" group, expand "Collapse" and select "Collapse selection".
The code is immediately collapsed and the "+" icon is displayed in front of the code.
Remark: To permanently expand this set of lines of code:
  1. Position the mouse cursor on this code.
  2. On the "Display" tab, in the "Collapsible code" group, expand "Collapse" and select "Expand permanently".

Declaring a custom code block

To declare a custom code block, use the following syntax:
<BLOCK>

...

<END>
where
<BLOCK Comment always displayed>

...

<END>
These blocks of code are used for example to highlight the different steps of an algorithm or to group the declarations of variables or members.
Example:
For more details, see the help about BLOCK.
Limits
WEBDEV - Server code Collapsing/Expanding code is not available in the page templates.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/22/2023

Send a report | Local help