16. Edit Operations

<< Previous Table of Contents   |   Detailed Index Next >>
1. Insert { } around single statements

In a file,

-   Click Insert→Insert { } around single statements

Crystal C/C++ scans the file for all condition statements like if( ), for( ; ; ), while( ), do( ), etc which are not followed by a pair of '{ }'.

It inserts a '{' immediately after the condition statement;

It inserts a '}' immediately after the following statement.

2. Swap YES and NO parts of an if..else ,, statement

-   Place the cursor on an "if( ) statement" or an "else"

-   Click Edit→Logic Change→Swap the parts of if_else_statement

3. Change do while to while loop

-   Place the cursor on a "do statement"

-   Click Edit→Logic Change→Change do_while loop to while loop

4. Change while loop to do while loop

-   Place the cursor on a "while statement"

-   Click Edit→Logic Change→Change while loop to do while loop

5. Rematch Braces

-   Place the cursor within a function

-   Click Edit→Logic Change→Rematch Braces

6. UnComment

To uncomment:

-   Place the cursor within a comment block /* */

-   Click Edit→Uncomment

7. Comment Out with /* */

-   Select a block of text to be commented.

-   Right click, then click Comment Out using /* */

8. Comment Out with //

-   Select a block of text to be commented.

-   Right click, then click Comment Out using //

9. Condition Out / Code out

-   Select the block of code to be coded out

-   Right click, then click Condition Out

10. Enclose in { }

-   Select the lines to be enclosed in { }

-   Right click, then click Enclose in { }

11. Enclose in ( )

-   Select the condition to be enclosed in ( )

-   Right click, then click Enclose in ( )

12. Delete a pair of { }. ( ), [ ], etc

-   Place the cursor within the pair of { }, ( ), [ ], etc that you wish to remove

-   Click the < DelPair> button

13. Move Comments to right

If comments are sprinkled among the statements, you can get an uninterrupted view of the code:

-   Click Edit → Move Comments → Move All Comments to Comment-field.

14. Shift a statement Up or Down

In the Tokens Panel,

-   Click <MvSnt ↑> to move the current sentence upward

-   Click <MvSnt ↓> to move the current sentence downward

15. Select the whole function, a while loop, a whole case, etc

Place the cursor in the desired function, or statement

-   Click on the Select Block icon on the main toolbar.

-   Choose from the drop-down list

16. Multiple Clipboards

Click Edit→Paste→Paste # N to display Multiple Clipboard.

<< Previous Table of Contents   |   Detailed Index Next >>