PDA

View Full Version : .pas filename obtaint via a const in the code?



NecroDOME
25-09-2009, 11:43 AM
is it possible to obtain the current file via a code constant? In C++ you can get the with __FILE__. Could this be done in Pascal/Delphi?

The reason I ask is for debugging purposes. I want the file name + line where the code breaks to speed up the development process.

Legolas
25-09-2009, 12:22 PM
AFAIR Free Pascal allows something like {$include %FILE%} and {$include %LINE%}