0

Some C++ code have used useful macros/variables such as :

 __FILE__, __LINE__, __FUNCSIG__, and so forth

Are there equivalent functionalities in Delphi ? If not, how should one implement custom functions to provide equivalent functionalities ?

Community
  • 1
  • 1
SOUser
  • 3,802
  • 5
  • 33
  • 63
  • 1
    Fundamentally, Delphi has nothing like these macros. The best you can do is implement bespoke solutions to whatever your problem is. But there are no drop in equivalents. – David Heffernan Nov 28 '15 at 08:25
  • @DavidHeffernan In the "dup" link that you have helped to provide, you mention that "If you use this as a debugging tool to trace errors you will seriously degrade the quality and maintainability of your source code and you will have a rather pathetic and crippled debugging tool in comparison to madExcept or other similar tools." I probably should just neglect those lines when reading C++ code... – SOUser Nov 28 '15 at 08:35
  • I am referring to code littered with Assert statements to fake line number getters. C++ code using the macros is readable. – David Heffernan Nov 28 '15 at 09:05
  • For your information, FPC [has such macros](http://www.freepascal.org/docs-html/3.0.0/prog/progsu41.html), and you can even [define your own set](http://www.freepascal.org/docs-html/3.0.0/prog/progse5.html) . – Arnaud Bouchez Nov 28 '15 at 09:07

0 Answers0