Tutorial :In Delphi IDE, how to quickly determine the location of an open non-project-related file?



Question:

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?


Solution:1

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


Solution:2

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.


Solution:3

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


Solution:4

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


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »