Advertisement
RandomClear

How to get source code location information

Jan 30th, 2013
616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.28 KB | None | 0 0
  1. uses
  2.   EClasses,
  3.   EDebugInfo;
  4.  
  5. procedure Test;
  6. begin
  7.  
  8. end;
  9.  
  10. procedure TForm1.Button1Click(Sender: TObject);
  11. var
  12.   Info: TELLocationInfo;
  13. begin
  14.   Info := GetLocationInfo(@Test);
  15.   Label1.Caption := Info.UnitName + '.' + Info.ProcedureName;
  16.   // Will output 'Unit1.Test'
  17. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement