[fpc-pascal] Getting the current Unit Name

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Jul 14 08:28:24 CEST 2013


On Sun, 14 Jul 2013 09:13:42 +0900
Noah Silva <shiruba at galapagossoftware.com> wrote:

> Hi,
> 
> In Delphi, there exists: TObject Class Function UnitName, which allows you
> to get the Unit of a given class.  This seems not to be implemented in
> FreePascal.

It exists since many years in fpc.
What compiler version are you using?

 
> If there a similar function available in FreePascal? (I am sure there is
> some way to do this using the VMT.)
> Alternatively, is there an easy way to just return the name of the current
> unit?


Mattias



More information about the fpc-pascal mailing list