IModule.Standalone

Syntax

Standalone: Boolean;

Description

The Standalone property returns whether the object is included in the assembly.

Comments

If a unit or form are included in any assembly, the property returns False and it is possible to get a description of parent assembly in the ParentAssembly property.

If a unit or form are not included in the assembly, they implement temporary assembly. In this case this property returns True and parameters of temporary assembly are available in the Assembly property.

Example

Executing the example requires that the repository contains a unit with the TestModule identifier.

Sub Main;
Var
    MB: IMetabase;
    Module: IModule;
Begin
    MB := MetabaseClass.Active;
    Module := MB.ItemById("TestModule").Bind As IModule;
    If Not Module.Standalone Then
        Debug.WriteLine("Parent assembly: " + Module.ParentAssembly.Id);
        Debug.WriteLine("Parent assembly links: " + (Module.ParentAssembly.Bind As IAssembly).References);
    Else
        Debug.WriteLine("Unit is not included in any repository assembly");
        Debug.WriteLine("Unit links: " + Module.Assembly.References);
    End If;
End Sub Main;

After executing the example the development environment console displays information about unit: parent assembly existence and connected assemblies.

See also:

IModule