RandomClear icon

How to get caller information

RandomClear | PRO | 01/30/13 07:20:23 AM UTC | 0 ⭐ | 762 👁️ | Never ⏰ | []
Delphi |

420 B

|

None

|

0 👍

/

0 👎

uses
  ECallStack,
  EClasses,
  EDebugInfo;
 
procedure TForm1.Button1Click(Sender: TObject);
 
  procedure Test;
  var
    Caller: Pointer;
    Info: TELLocationInfo;
  begin
    Caller := TEurekaStackList.Caller;
    Info := GetLocationInfo(Caller);
    Label1.Caption := Info.UnitName + '.' + Info.ClassName + '.' + Info.ProcedureName;
    // Will output: 'Unit1.TForm1.Button1Click'
  end;
 
begin
  Test;
end;

Comments