- 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
Code editor: Various operations
The code editor is the editor where the developers spend most of their time. This help page presents a series of useful options for the most common actions: 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. 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. Remark: When the secondary keywords (ELSE, END, etc.) are hovered by the mouse cursor, the associate condition is displayed in a tooltip. Finally, the current line can be easily identified via dots used to highlight the current line.
All these options can be modified if necessary. To modify the highlighting options: - Display the configuration window of code editor: on the "Home" tab, in the "Environment" group, expand "Options" and select "Options of the code editor".
- 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".
- Validate.
Remark: All the colors used to highlight the elements can be configured in the "Coloring" tab of the configuration window of code editor. 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.
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, ... - On the "Code" tab, in the "Navigation" group, type the event you want to find. Remark: To automatically display the list of events, use Alt + C.
- 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. New in version 28Remark: 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: - Position the cursor at the beginning of the area to select.
- Press and hold the Alt key.
- Press the left mouse button and select the desired area.
New in version 28Remark: This selection can also be made with the keyboard: - Position the cursor at the beginning of the area to select.
- 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.
Remark: When the area is pasted to another rectangular area, the copied text keeps its format.
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: - Position the cursor in the block to select.
- Press Ctrl + Alt + Up arrow to select the block found above the cursor. Repeat this operation as many times as necessary.
- 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. New in version 28Delete 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,
New in version 28the Right arrow key.
New in version 28Information 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:
Reverse assignments To reverse an assignment: - Select the line of code that contains the assignment.
- 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: - Select one or more words in the code editor.
- Press the quote, square bracket or bracket key.
- 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: - Select one or more words in the code editor.
- 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: - Position the cursor in the desired code.
- 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: - Position the cursor at the beginning of code to move.
- Select the procedure or method code: use the mouse or press Ctrl + A for example.
- Cut the procedure or method (Ctrl + X).
- Position the mouse cursor at the new position of procedure or method.
- 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:
This page is also available for…
|
|
|