ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Editors / Code editor
  • Overview
  • Highlighting selected elements
  • Finding code
  • Search in a selection
  • Finding and accessing an event
  • Selection in the code editor
  • Selecting lines of code
  • Rectangular selection
  • Selection by level of blocks
  • Handling one or more lines of code
  • Selecting lines of code
  • Moving lines of code
  • Duplicating lines of code
  • Delete parts of lines of code
  • Go to the next line
  • Information about the selected lines of code
  • Reverse assignments
  • Adding quotes/square brackets or brackets automatically
  • Switching a text into uppercase/lowercase
  • Description window of the current element from the code editor
  • Moving procedures or methods
  • Creating a procedure with the keyboard
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
Highlighting selected elements
In the code editor, whenever the cursor is positioned on an identifier (variable, procedure, data file, etc.), all uses of this identifier are highlighted in the current code.
Highlighting
Similarly, if the mouse cursor is positioned on a block statement (IF, THEN, ELSE, FOR, END, LOOP, WHEN EXCEPTION ON, etc.), the different elements of this block are highlighted.
Highlighting a block of code
Remark: When the secondary keywords (ELSE, END, etc.) are hovered by the mouse cursor, the associate condition is displayed in a tooltip.
Condition in a tooltip
Finally, the current line can be easily identified via dots used to highlight the current line.
Highlighting the current line
All these options can be modified if necessary.
To modify the highlighting options:
  1. Display the configuration window of code editor: on the "Home" tab, in the "Environment" group, expand "Options" and select "Options of the code editor".
  2. In the "Code" tab, select the following options if necessary:
    • "Highlight the blocks of code (IF/THEN/END, brackets, ...)".
    • "Highlight the current line".
    • "Highlight the declaration and the uses of the variable".
  3. Validate.
Remark: All the colors used to highlight the elements can be configured in the "Coloring" tab of the configuration window of code editor.
Finding code
To find an element in the code editor, all you have to do is use the "Find/Replace" pane, enabled via Ctrl + F.
To perform an immediate search on an element found in the code editor, all you have to do is press Ctrl F3 on an element of code editor (the "Find/Replace" pane being displayed).
Pressing Ctrl + F3:
  • fills the search control with the word onto which the cursor is positioned.
  • triggers the search.
  • highlights in the code all the occurrences found and positions on the first occurrence.
The F3 and Shift + F3 keys allow you to navigate from an occurrence to another one via the keyboard.

Search in a selection

The code editor allows you to perform a search (and a replacement) in a selection.
If a selection exceeding one line is active, the search is automatically performed in this selection.
When performing a search in a selection, the searched word is highlighted in the code.
Sought word highlighted
F3 and Shift + F3 allow you to go from one occurrence to another.

Finding and accessing an event

The code editor allows you to find and access an event of the current element: window, page, report, ...
  1. On the "Code" tab, in the "Navigation" group, type the event you want to find.
    Search an event
    Remark: To automatically display the list of events, use Alt + C.
  2. Select the desired event in the list. It is automatically displayed in the code editor.
Selection in the code editor

Selecting lines of code

To perform a simple selection:
  • One click positions the cursor.
  • Two clicks select the word.
  • Three clicks select the line.
  • Four clicks select the entire text.
Syntax highlighting is kept when text is selected.
Remark: To select the word at the cursor position, you can also press Ctrl + Shift + E.

Rectangular selection

You can select a horizontal or vertical rectangular text area in the code editor. This area can be copied/cut and pasted.
To perform a rectangular selection:
  1. Position the cursor at the beginning of the area to select.
  2. Press and hold the Alt key.
  3. Press the left mouse button and select the desired area.
Remark: This selection can also be made with the keyboard:
  1. Position the cursor at the beginning of the area to select.
  2. Use Alt + Shift + Arrow keys (up, down, right, left) to select the desired area.
The area can then be copied/cut via the context menu.
Rectangular selection
Remark: When the area is pasted to another rectangular area, the copied text keeps its format.
Rectangular selection

Selection by level of blocks

You have the ability to perform a selection by level of code blocks.
To perform a selection by level of blocks:
  1. Position the cursor in the block to select.
  2. Press Ctrl + Alt + Up arrow to select the block found above the cursor. Repeat this operation as many times as necessary.
  3. Press Ctrl + Alt + Down arrow to deselect the block found above the cursor. Repeat this operation as many times as necessary.
Handling one or more lines of code

Selecting lines of code

  • One click positions the cursor.
  • Two clicks select the word.
  • Three clicks select the line.
  • Four clicks select the entire text.

Moving lines of code

A selected area (one or more lines of code) can be moved directly using the key combination Alt + Up Arrow or Alt + Down Arrow.

Duplicating lines of code

The duplication of lines of code (Ctrl + D) operates on a single line or on a selection of lines of code.

Delete parts of lines of code

To delete:
  • the code before the cursor (on the same line): Ctrl + Shift + Backspace
  • the code after the cursor (on the same line): Ctrl + Shift + Del

Go to the next line

When you are writing code and you reach the end of the line, you can use:
  • the Enter key,
  • the Right arrow key.

Information about the selected lines of code

When you select one or more lines of code, the status bar of the code editor displays the following information:
SEL <Selected characters>|<Selected lines>

For example, when you select 3 lines of code, you might see the following:
50|3

Reverse assignments

To reverse an assignment:
  1. Select the line of code that contains the assignment.
  2. Press Ctrl + Alt + = to reverse the assignments.
For example, the following code:
nx is int
ny is int
 
nx = ny
becomes
nx is int
ny is int
 
ny = nx
Adding quotes/square brackets or brackets automatically
To automatically add quotes, square brackets or brackets:
  1. Select one or more words in the code editor.
  2. Press the quote, square bracket or bracket key.
  3. The selected text is automatically enclosed between 2 quotes, 2 square brackets or 2 brackets.
Switching a text into uppercase/lowercase
To automatically switch a text found in the code editor into uppercase or lowercase characters:
  1. Select one or more words in the code editor.
  2. Press the following key combination:
    • Ctrl + M: to switch the selected text into lowercase.
    • Ctrl + Shift + M: to switch the selected text into uppercase.
Description window of the current element from the code editor
To display the description window of the element corresponding to the displayed code:
  1. Position the cursor in the desired code.
  2. Press the following key combination: Alt + Enter.
Moving procedures or methods
The procedures or the methods are displayed in their creation order by default. To move a procedure or a method:
  1. Position the cursor at the beginning of code to move.
  2. Select the procedure or method code: use the mouse or press Ctrl + A for example.
  3. Cut the procedure or method (Ctrl + X).
  4. Position the mouse cursor at the new position of procedure or method.
  5. Paste the procedure or method (Ctrl + V).
The procedure or method was moved.
Creating a procedure with the keyboard
To create a global procedure, you can:
  • use the project explorer.
  • use the "Code" pane of code the editor ("New" button).
  • type the prototype of the procedure to create at the end of an existing procedure.
To create a local procedure, you can:
  • use the "Project explorer" pane.
  • use the "Code" pane of code the editor ("New" button).
  • type the prototype of the procedure to create in the "Global declarations" event of the window or page.
For more details, see:
Minimum version required
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/12/2022

Send a report | Local help