Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

ide

delphi

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?

like image 416
Jamo Avatar asked Jun 24 '09 20:06

Jamo


4 Answers

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.

like image 75
Mason Wheeler Avatar answered Nov 04 '22 23:11

Mason Wheeler


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

like image 44
Erika Avatar answered Nov 05 '22 00:11

Erika


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

like image 45
skamradt Avatar answered Nov 04 '22 23:11

skamradt


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

like image 32
gabr Avatar answered Nov 05 '22 00:11

gabr