tags:

views:

350

answers:

4

This is probably a question that has an easy/simple/obvious answer, but I've found myself asking it many, many times, and never able to answer it:

When I Ctrl-click a class name, Delphi loads up the unit that defines it (assuming it's on the browse path). Once it's open in the IDE, is there a way to quickly find out where that PAS file resides folder-wise, on the hard drive?

+16  A: 

In Delphi 2009 you can hover over the tab at the top of the code.

Erika
I *knew* it was something simple, but didn't have a clue where it was. Works like this is D2007 too. Thanks very much!
Jamo
And it works in D2006
Gerry
+24  A: 

Erika's got a good answer. Here's an even better one: You can have Delphi open the Windows folder and highlight the file for you. Here's how to set it up:

Tools menu -> Configure Tools -> Add

Title: Explore
Program: Explorer.exe
Working dir: <leave blank>
Parameters: /select, $EDNAME

This is a simple little trick that can be very handy if you want to locate a file.

EDIT: One note: If you currently have a Windows Explorer window open to the folder that the file's in, it will activate the window but not select the file.

Mason Wheeler
Mason, you rock. This is one of those moments I wish I could check TWO answers as the answer! Thanks so much -- this is great.
Jamo
Sweet. That is a great trick.
Erika
Sweet. I've used this before but that /select parameter rocks... Up vote!
Fabricio Araujo
+1 for a simple, elegant and hugely useful idea.
Cobus Kruger
+1 for neat and useful idea - thanks
Despatcher
+3  A: 

Usually File->Save As also defaults to the correct folder.

For example, if you position the caret inside a unit name and press Ctrl-Enter (which, BTW, works even if program is running in the debugger when Ctrl-Click doesn't) and do File->Save As, you'll be taken to the correct folder.

At least that's how I was always doing that - before learning two new tricks here :)

gabr
+3  A: 

If you install CNPack, a free Delphi plugin, you can also right click on a tab and will be offered a popup menu which includes the ability to open the edited file in explorer (much like Mason's tools trick).

skamradt