How to get line number at runtime

后端 未结 5 1407
误落风尘
误落风尘 2020-12-03 09:16

is it possible to get source line number at runtime in Delphi? I know JCL debug, but I want to avoid to use it. Also Assert is not exactly what I want. I would like to get s

5条回答
  •  执笔经年
    2020-12-03 09:30

    Note: This answer addresses the following question.

    Is it possible to get source line number at runtime in Delphi?

    You can't do this without a map file or something equivalent. The process of compilation leaves the source code behind.

    It's not practical to litter your source code with pre-emptive checks for errors. What's more, doing so will only give you very limited information for a very limited number of faults in your code. Generally, if you can anticipate an error, you won't get it wrong. It's the errors that you don't anticipate that make it into production code.

    Really you are best off using madExcept, EurekaLog or JclDebug.

提交回复
热议问题