How to get line number at runtime

You can indeed use Assert for this. Write a procedure that matches the signature dictated by the TAssertErrorProc type, and then do whatever you want there. To preserve the expected behavior, you should probably call the original handler after you’re finished. procedure MichaelAssertProc(const Message, Filename: string; LineNumber: Integer; ErrorAddr: Pointer); begin LogMessage(…); SysUtils.AssertErrorHandler(Message, Filename, LineNumber, … Read more

How to translate (internationalize, localize) application?

GetText should be able to do, search for “extract” at http://dxgettext.po.dk/documentation/how-to If all you need is to translate GUI and maybe resourcestring in sources, and the inline string constants in Pascal sources are not needed for translation, then you can try Delphi built-in method. However forums say that ITE is buggy. But at least that … Read more

Masking floating point exceptions with Set8087CW, SetMXCSR and TWebBrowser

Assuming that you have no need for floating point exceptions to be unmasked in your application code, far and away the simplest thing to do is to mask exceptions at some point in your initialization code. The best way to do this is as so: SetExceptionMask(exAllArithmeticExceptions); This will set the 8087 control word on 32 … Read more