IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
Delphi
Search Delphi Group:

Advanced
-Collapse +Expand Delphi To/From
To/FromCODEGuides
-Collapse +Expand Delphi Store
PRESTWOODSTORE

Prestwood eMagazine

March Edition
Subscribe now! It's Free!
Enter your email:

   ► KBProgrammingDelphi for W...Tool Basics   Print This     
  From the December 2010 Issue of Prestwood eMag
 
Delphi Tool Basics:
Delphi Editor Tips and Tricks
 
Posted 22 years ago on 3/18/2003 and updated 12/20/2010
Take Away:

Borland Delphi editor tips and tricks.

KB100148

Introduction

During this talk with a local user group I discussed some of the many editor tips and tricks available to you.  These tips use the Default key mapping module. In general these tips will stay away from form designer and debugger topics. Primarily because those subjects warrant a whole discussion on their own.

1.  Line Delete

Ctrl+Y

2.  Move by words

a Windows standard

Key points:

a. hold down Ctrl key and use left and right arrows

b. Shift+Ctrl key to select by words

c. Use to jump around quickly and select and cut or copy sections quickly

Also:

a. Home = beginning of line

b. End = end of line

c. Ctrl+Home = beginning of file

d. Ctrl+End = end of file

e. Shift+End = select to end of line

d. Shift+Home = select to beginning of line

f. Ctrl+Shift+End = select to end of file

3.  Handling Case

Key points:

a.       to uppercase = Ctrl+K+F

b.      to lowercase = Ctrl+K+E

c.       toggle = Ctrl+O+U

 

4.  Selecting Rectangles of Text

Key points:

a. Alt key

b. kind of a Windows standard (also works in Word)

5.  Indenting Blocks

Key points:

a. to indent, select block, then Ctrl+Shift+I

b. to Unindent, select block, then Ctrl+Shift+U

6.  Incremental Search...HOT FEATURE

Key points:

a. Ctrl+e to invoke

b. F3 to search again

c. searches down only so use Ctrl+Home to go to top first (if desired)

7.  Bookmarks

Key points:

a. set a bookmark = Ctrl+Shift+0 to 9

b. goto a bookmark = Ctrl+0 to 9

c. also available on the right click menu

8.  Browsing in the editor

point at classes...use cntrl to jump

 

9.  Class Completion

Ctrl+Shift+C

a. Minimum to use is:

   MyClass = class(TObject)

   end;

b. Then add whatever methods, properties, or events and then activate by pressing Ctrl+Shift+C

For example:

in public: procedure HelloWorld(Message : String);

in public: property Age: Integer

Add this to form public: function GetAgeOfEarthInYears: Integer;

10.           To-Do List

comment with todo # -o -c: todohere

a.       View | ToDo List...right click...Add

b.      Project | View Source...notice .todo file...right click...Open File at Cursor...notice syntax

c.       HOT FEATURE...add todo right in your code and it's surfaced in todo list.

complete syntax

// TODO 1 -oMP -cAddition : Complete GetAgeOfEarthInYears

minimum syntax

// todo: complete HelloWorld

 

d. to complete a todo item change todo to done or use interface.

e. show Table Properties...show todo.html

11.           Code Explorer

View | Code Explorer

Key points:

a. Jump to code by double clicking

b. Variables/Constants shows global only (not within a method) but from both interface and implementation

c. Uses shows all uses from both interface and implementation

d. Settings = Explorer tab on Environment Options...show this...also, right click and select properties

12.           Code Completion

Key points:

a. wait or press Ctrl+space

b. type first few characters and press space to complete

c. esc to get rid of it (or just ignore it)

13.           Code Parameters

Key points:

a. ( then wait to invoke

b. keyboard shortcut is Ctrl+Shift+Space

 

14.           Code Templates

Key Points:

a. two ways to invoke

   1. Cntl+J to invoke then to select, type first few chars and return

   2. shortcut name and Ctrl+J

b. to add, Tools | Editor Options | Code Insight tab

example

msgok MessageDlg('|', mtInformation, [mbOK], 0);

(notice | is where cursor will be)

15.           Interface / Implementation Navigation

Key points:

a. moves between interface and implementation for a method

b. keyboard=Ctrl+Shift+Up and Ctrl+Shift+Down

16.           Tools | Editor Options

Go through Tools | Editor Options.

Key points:

a. General tab: Editor SpeedSetting, Tab Stops,  Undo After Save (normally unchecked), Find Text at Cursor

b. Display tab: Create Backup File (disable to get rid of annoying ~ files if desired), Zoom to Full Screen

c. Key Mappings: none.

d. Color: none.

e. Code Insight: already discussed.

 

17.           Desktops Toolbar

Key points:

a. Save various desktops

b. great to use with Zoom to Full Screen on Display tab of Editor Options

c. Show samples: Normal, CodeExplorer, FullScreen, FullScreenEx (also point out usage with Zoom to Full Screen)

d. Set Debug Desktop

e. Also available thru View | Desktops


Comments

0 Comments.
Share a thought or comment...
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1205A1
Enter key:
KB Post Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile

 KB Article #100148 Counter
14564
Since 4/2/2008
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2025 Prestwood IT Solutions.   [Security & Privacy]