Thursday, October 15, 2009

Delphi Tips and Tricks - Additional Files

One of the most useful features in the Delphi IDE is CTRL + F12, or the "Search for units" dialog. One of the problems we encounter is we often want to look at files that are not in any of the opened projects. So a hidden registry key was created to add a list of files to the "Search for units" dialog. You can specify the text file by creating a string value under HKEY_CURRENT_USER\Software\CodeGear\BDS\\Globals named "AdditionalViewFiles". Set the string to the file you want the IDE to load. Note that IDE environment variables can be used here. For Example I have $(TP) set to "c:\source" and the AdditionalViewFiles string value is set to $(TP)\AdditionalViewFiles.txt.

The text file format is name value pairs like any other INI file where the name is the short name you want to see and the value is the full path to the file (and this will expand IDE environment variables as well). For example:

Foo.pas=$(TP)\somedirectory\Foo.pas

3 comments:

Xepol said...

Sounds like something that should be a full, formal feature instead of a registry key and text file kludge.

Kind of a "favorites" or "most used" feature. I know I have those types of files I open semi-frequently for reference purposes (code is wonderfully self documenting)

Maybe for the next release?

Yahoo Serious said...

Nice feature, introduced in what version?
The thing I miss most in Ctrl-F12 (D2007), is the include-files. We have a lot of them (mostly including constants), and they are project dependent.
This could be a work-around, but then inc-files for all projects will be shown in all projects, which does seem like a lot of garbage.
So for inc-files I would also like a 'full formal feature'.

PS: is it just me (my system, Firefox) or are navigational keys (arrows, home, end) disabled in this comment-box?

Chris Bensen said...

This is one of the ways full blown features become a reality - someone wants something, someone does something to make it work (often times it is in-house only), it becomes useful, the ideas start flying and it gets into the next product as a a feature every Delphi and C++Builder developer use on a daily basis. We are at stage 1; someone wanted something and did something about it.

Yahoo Serious,

This feature was introduced in Delphi 2009. I'm using Chrome and everything works fine. I also tried it from Safari and it works fine there too.

Post a Comment