IMetabaseObjectHistory.Count

Syntax

Count: Integer;

Count: integer;

Description

The Count property returns the number of the records in the object's history.

Example

Executing the example requires that the repository contains an object with the ObjTest identifier.

 Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    Desc: IMetabaseObjectDescriptor;
    Histor: IMetabaseObjectHistory;
    Item: IMetabaseObjectHistoryItem;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    Desc := Mb.ItemById(
"ObjTest");
    Histor := Desc.GetHistory;
    
For i := 0 To Histor.Count - 1 Do
        Item := Histor.Item(i);
        Debug.WriteLine(Item.Id + 
" " + Item.Name + " " + DateTime.FromDouble(Item.Stamp).ToString);
    
End For;
End Sub UserProc;
Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Desc: IMetabaseObjectDescriptor;
    Histor: IMetabaseObjectHistory;
    Item: IMetabaseObjectHistoryItem;
    i: Integer;
Begin
    MB := Params.Metabase;
    Desc := Mb.ItemById["ObjTest"];
    Histor := Desc.GetHistory();
    For i := 0 To Histor.Count - 1 Do
        Item := Histor.Item[i];
        System.Diagnostics.Debug.WriteLine(Item.Id + " " + Item.Name + " " + DateTime.FromOADate(Item.Stamp).ToString());
    End For;
End Sub;

After executing the example information about the ObjTest object changing is displayed in the development environment console. Identifiers, names, date and time of objects changing are also displayed.

See also:

IMetabaseObjectHistory