IForeAssembly.SubItem

Syntax

SubItem(SubIndex: Integer): IForeSub;

Parameters

SubIndex. Procedure/function index. The index value is specified in the [0, SubsCount-1] range.

Description

The SubItem method returns information about procedure/function with the specified index.

Example

Executing the example requires that repository contains an assembly with the ASSM_TEST identifier.

Add a link to the Fore, Metabase system assembly.

Sub UserProc;
Var
    ForeService: IForeServices;
    Runtime: IForeRuntime;
    Assm: IForeAssembly;
    FSub: IForeSub;
    i, j: Integer;
Begin
    ForeService := MetabaseClass.Active 
As IForeServices;
    Runtime := ForeService.GetRuntime;
    
//Load assembly
    Assm := Runtime.BindToAssembly("ASSM_TEST");
    //Get information about procedures/functions implemented in assembly global namesapce
    j := Assm.SubsCount - 1;
    
For i := 0 To j Do
        FSub := Assm.SubItem(i);
        
If FSub.IsResult Then
            Debug.Write(
"Function: ");
        
Else
            Debug.Write(
"Procedure: ");
        
End If;
        Debug.Write(FSub.Name);
        Debug.Write(
"; Access modifier: ");
        
Select Case FSub.SubAccessSpecificatorKind
            
Case AccessSpecificatorKind.Public_: Debug.WriteLine("Public");
            
Case AccessSpecificatorKind.Private_: Debug.WriteLine("Private");
            
Case AccessSpecificatorKind.Protected_: Debug.WriteLine("Protected");
            
Case AccessSpecificatorKind.Friend_: Debug.WriteLine("Friend");
            
Case AccessSpecificatorKind.ProtectedFriend: Debug.WriteLine("ProtectedFriend");
        
End Select;
    
End For;
End Sub UserProc;

On executing the example, the repository assembly with the specified identifier will be loaded to the execution environment. The development environment console will display a list of procedures/functions implemented in assembly global namespace.

See also:

IForeAssembly