Getting the current line number in Delphi

Note to self: There is an easy way to get the current line number in Delphi, using the following function and JclDebug: [delphi] function GetCurrentLineNumber: Integer; var ModInfo: TJclLocationInfo; begin ModInfo := GetLocationInfo(ReturnAddress); Result := ModInfo.LineNumber; end; [/delphi] ReturnAddress is a compiler magic function in the system unit, introduced with Delphi XE2. TJclLocationInfo and GetLocationInfo … Continue reading Getting the current line number in Delphi