10

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?

4 Answers 4

32

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, in XP it will activate the window but not select the file. In Vista and Win7, it will open a new copy of the window.

4
  • 1
    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
    Commented Jun 24, 2009 at 20:33
  • 1
    Sweet. I've used this before but that /select parameter rocks... Up vote! Commented Jun 24, 2009 at 23:23
  • This should be as default in Delphi. +1 Commented Apr 4, 2011 at 12:41
  • ...and, unlike the tab hover, this works with Delphi 5. Thanks! Commented Dec 21, 2012 at 20:40
17

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

1
  • 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
    Commented Jun 24, 2009 at 20:39
5

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).

3

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 :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.