Root > Reference > Main routines > ReturnAddress

Function ReturnAddress

Previous pageReturn to chapter overviewNext page   

Returns address of caller function.

 

Unit

ECallStack

 

Syntax

 

Code (Delphi)

function ReturnAddress: Pointer;

 

Return value

A pointer to CPU opcode following instruction which called the current function.

 

Remarks

Use this function to obtain a pointer to the caller of the current location, which you can use to either build a call stack or obtain a human-readable description.

 

Examples

 

Code (Delphi)

procedure Test;

var

Info: TELLocationInfo;

begin

Info := GetLocationInfo(ReturnAddress);

ShowMessage(LocationToStr(Info, False, False, False, False, False));

// Will show: 'Unit1.TForm1.Button1Click (Line 42, "Unit1.pas")'

end;

 

procedure TForm1.Button1Click(Sender: TObject);

begin

Test;

DoSomethingElse; // <- this is line #42 in the Unit1.pas file

end;

 

See also




Send feedback... Build date: 2026-03-31
Last edited: 2026-03-31
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.


Permanent link to this article: https://www.eurekalog.com/help/eurekalog/topic_function_ECallStack_ReturnAddress