Block Operations

Top  Previous  Next

Block operations apply an editing action to more than one character at once. The Source window supports persistent blocks and performs a full range of operations with standard (stream), vertical (column) and line blocks of text.

Non-persistent blocks In this mode, once a block is marked, you have to immediately carry out an operation with it (delete, copy, etc.), because any movement of cursor takes the marking off the block. If a block is marked, then any entered text will replace the block with the typed text.

Persistent blocks In this mode, the block remains marked until the marking is explicitly removed (hot key Shift+F3) or the block is deleted (Ctrl+X). The Paste operation for persistent blocks has specifics. Two additional block operations are available for persistent blocks: fast copy and fast move. These operations do not use the clipboard and require fewer manipulations of the keyboard.

To enable the persistent block mode check the namesake box on the Main menu > Configure>Editor Options> General  tab.

Standard blocks The standard (stream) block contains a "text stream" that begins from the initial line and column of the block and ends at the final line and column.

The Standard blocks is enabled by default.

Line blocks  The line block contains whole lines of text. To mark a line block, put the cursor anywhere in the first line and press Alt+Z; then put the cursor anywhere in the last line of the block and press Alt+Z once more (the latter is not necessary if the block is to be immediately deleted or copied to the clipboard).

Line blocks are always available.

 

Vertical blocks  The vertical block contains a rectangular text fragment. Characters within the block, which goes beyond the end of the line, are considered to be spaces. Vertical blocks are convenient in cases like the following example of source text:

char Timer0 far ;

char Timer1 far ;

char Int0 far ;

char Int1 far ;

Assume the word "far" is to be moved to the place right after the word "char" in each line. The stream blocks are of little help here. However the task can be easily done with one vertical block. Mark the persistent vertical block containing the word "far" in each line, place the cursor on the first letter of word "Timer0" and press Shift+F2 (fast move the block):

ebx_642996212

 

Checking/Clearing the Vertical Blocks box toggles between the vertical block and the stream block modes in the the Main menu > Configure>Editor Options> General  tab. The standard blocks are enabled by default; i.e. the Vertical Blocks box in the Editor Options dialog is unchecked by default. The line blocks are always accessible, irrespective of the status of the Vertical Blocks box.

To mark a block, either move the mouse while pressing its left button or use the arrow keys of the keyboard while pressing the Shift key. To unmark the block, press Shift+F3.

Copying / moving blocks

A marked block can be copied or moved within the same Source window in two ways: directly (fast copying, fast moving) and through the clipboard (Copy/Cut-n-Paste). Copying and moving blocks between the Source windows, or to another application should always be made through the clipboard.

Note. The result of copying the stream or vertical non-persistent block depends on the INSERT mode. If the mode is enabled, then the block is inserted into the text, starting at the cursor position; otherwise the copied block overwrites the text on an area of equivalent size.

Fast copying / moving

Fast copying (moving) the blocks in the same window directly (without the clipboard) is convenient because it requires pressing of keys only once per operation. Mark a persistent block, then place the cursor at the destination position and press Shift+F1 to copy, or Shift+F2 to move.