Delphi coding hints and tips.
Delphi editor, dropping files, file types, and shortcut keys
Dropping files into editor
If you wish to open a file with the Delphi editor rather than use the File|Open dialog you can drag and drop files onto the editor. For example if you locate a .pas file with explorer which you wish to view the source, just drag from explorer onto the Delphi editor and it will be opened.
File types.
You can open any file type within the Delphi editor. Obviously some file types like a .res resource or a raw .exe file will no make much sense once opened. But .txt files, .html files .sql script files will be read just fine. I have noticed also that syntax colour highlighting works for .sql files although not 100%.
Shortcut keys.
I tend to use mainly the keyboard while coding as I find it a lot faster than using a mouse. If you have never checked out the shortcut keys with the Delphi editor I recommend you do so. Lookup help on 'Keyboard shortcuts' and try them out within the editor. The just few to get you started:-
| Ctrl+Shift+g | Inserts a new Globally Unique Identifier (GUID) |
| Ctrl+K+E | Changes a word to lowercase |
| Ctrl+K+E | Changes a word to lowercase |
| Ctrl+Q+Y | Deletes to the end of a line |
| Alt+0 | View|Window List |
| Ctrl+F2 | Run|Program Reset |
| Ctrl+Shift+P | Plays back a key macro |
| Ctrl+Shift+R | Records a key macro |
| Ctrl+O+C | Marks a column block |
| Ctrl+K+C | Copies a selected block |


