Thank you all. It looks like {$I %CURRENTROUTINE%} would do the trick, and will be available in next version of FPC. In the meantime, I believe a regular expression will allow me to replace the phrase CurrentRoutineName with the actual current routine name, so I am content.