ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Editors / Code editor
  • Overview
  • How to?
  • Indenting an existing code
  • Configuring the automatic reindentation of a pasted code
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
When typing compound statements ("Switch", "For" and "While", for example), the code is automatically indented to highlight the structure of the loops used in the program.
As soon as the first statement is typed, the "END" keyword is automatically inserted and the cursor is positioned in the compound statement.
Automatic indentation also allows aligning by the '=' sign and the word 'is'.
How to?

Indenting an existing code

Several options can be used to indent an existing code or the code currently typed:
  • To indent the current line of code to the left go to the "Code" tab, "Edit" group and click "Unindent".
  • To indent the current line of code to the right go to the "Code" tab, "Edit" group and click "Indent".
  • To automatically indent the entire code, on the "Code" tab, in the "Edit" group, click "Auto re-indent." (or press Ctrl + R).
To configure the automatic reindentation options:
  • Position the cursor in the code editor (but not on a line that contains WLanguage code).
  • On the "Code" tab, in the "Edit" group, expand "Auto re-indent." (or press Ctrl + R).
  • A window allows you to configure the scope of automatic indent. The scope may correspond to:
    • current code: only the process being edited (where the cursor is located) is reindented.
    • current element: all the events associated with the current element in the code editor are reindented (for example, all the codes of the window, controls and menus associated with the window).
    • the entire code displayed in the active code window: all the events or processes currently displayed in the code window will be reindented.
    • all the WLanguage code of the project: all the events of all the project elements.
  • The "Align by '=', 'is', '//'" option allows aligning all the text and code to the right of '=', 'is' or '//'.
    This option will be automatically taken into account for all subsequent automatic reindentations with Ctrl + R.

Configuring the automatic reindentation of a pasted code

To automatically reindent the code during a copy/paste:
  1. Open the code editor options: on the "Home" tab, in the "Environment" group, expand "Options" and select "Options of the code editor".
  2. In the "Code" tab, check "Indent (pasted code is edited and indented to fit layout)".
    Indentation option
Minimum version required
  • Version 9
This page is also available for…
Comments
spaces instead of tabs
is there a way for auto-indent to instert 3 or 4 spaces instead of a tab character ?
brys
09 Sep. 2024

Last update: 04/25/2024

Send a report | Local help