Board index » delphi » How to access procedure name ?

How to access procedure name ?

If I want to log errors, how can I access the procedure name the error
came from?

Vidar

 

Re:How to access procedure name ?


   WOW!!! That's a good question.

   If you have answer, please feedback.

   TIA

Quote
nor...@telepost.no (Vidar Eriksen) wrote:
>If I want to log errors, how can I access the procedure name the error
>came from?

>Vidar

--

          ___                                              ___
          L_|_                                            _|_J
         ( -O>                                            <O- )
      ___//\J  __________________________________________  L/\\___
     //-,\    |                                          |    /,-\\
    || / \\___L   AVONTURE Christophe (c) AVC Software   J___// \ ||
  _ ''/\/ '---J    Christophe.Avont...@is.belgacom.be    L---' \/\'' _
 / \ //\\.    |__________________________________________|    .//\\ / \
|_/\'/  ||                                                    ||  \'/\_|
     '   ||_         "Make sure that, always!, you            _||   '
         |__)       reply to my private mail adress"         (__|

Delphi Super Page: http://sunsite.icm.edu.pl/archive/delphi/_index.html

 "Postings are personnal, and don't reflect Belgacom's opinion"

Re:How to access procedure name ?


Quote
>nor...@telepost.no (Vidar Eriksen) wrote:
>>If I want to log errors, how can I access the procedure name the error
>>came from?

>>Vidar

Compiled applications don't retain any of the string identifiers of
the original source code.  Procedures get compiled down to machine
code addresses, which is all the CPU needs.

However, Delphi builds Run-Time Type Info for published properties and
methods of classes, and that RTTI info can include the names of
methods declared in a published section of the class.
TObject.MethodName will return the name of a method, if any RTTI
exists for the indicated method.

Delphi doesn't generate RTTI for stand-alone procedures and functions,
so there is no way to get the original source code symbol name at
runtime.

RTTI is discussed in detail in my upcoming book, "Delphi Component
Design".

-Danny Thorpe
==============
 Danny Thorpe
 author of "Delphi Component Design" 1996 Addison Wesley
 ISBN 0-201-46136-6
==============

Other Threads