Active: IModule;
The Active property returns the current unit, in which the current code is executed.
Add links to the Fore, Metabase system assemblies.
Sub UserProc;
Var
CurMod: IModule;
MObj: IMetabaseObjectDescriptor;
Begin
CurMod := ModuleClass.Active;
MObj := CurMod As IMetabaseObjectDescriptor;
Debug.WriteLine("Current unit: " + MObj.Name + '(' + MObj.Id + ')');
End Sub UserProc;
After executing the example the the development environment console displays name and identifier of the unit, in which the current code is executed.
See also: