IRubricatorFactsLookup.Current

Fore Syntax

Current: IRubricatorFactData;

Fore.NET Syntax

Current: Prognoz.Platform.Interop.Cubes.IRubricatorFactData;

Description

The property is read-only.

The Current property returns the current record in array of found factors.

Comments

Call the IRubricatorFactsLookup.Open method before the current record is obtained, that is, open a cursor that enables the user to navigate through the array of found data.

Fore Example

Executing the example requires that the repository contains a time series database with the FC_COMM identifier. This database must include attribute of the factor with the COUNTRY identifier. Add links to the Metabase, Cubes, Rds, Orm system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    RubDesc: IMetabaseObjectDescriptor;
    RubrIn: IRubricatorInstance;
    FactsLookup: IRubricatorFactsLookup;
    MetaDLookup: IMetaDictionaryLookup;
    cond: IOrmCondition;
    FactData: IRubricatorFactData;
    i: Integer;
    fdMembers: IMetaDataMembers;
    Value: Variant;
Begin
    MB := MetabaseClass.Active;
    RubDesc := MB.ItemById("FC_COMM");
    RubrIn := RubDesc.Open(NullAs IRubricatorInstance;
    FactsLookup := RubrIn.CreateFactsLookup;
    MetaDLookup := FactsLookup.Lookup;
    cond := MetaDLookup.Where.Add;
    cond.AttributeName := "COUNTRY";
    cond.Value := 512;
    FactsLookup.Open(DictionaryCursorOptions.None);
    FactData := FactsLookup.Current;
    If FactData <> Null Then
    fdMembers := FactData.Record.Members;
        For i := 0 To fdMembers.Count - 1 Do
            Debug.Write(fdMembers.Item(i).Attribute.Name + ": ");
            Value := fdMembers.Item(i).Value;
            Debug.WriteLine(value);
        End For;
    End If;
    FactsLookup.Close;
End Sub UserProc;

After executing the example search is executed by the last condition: value of the COUNTRY attribute of the factor is equal to 512. Data of the first found factor is displayed in the console window.

Fore.NET Example

Executing the example requires that the repository contains a time series database with the FC_COMM identifier. This database must include attribute of the factor with the COUNTRY identifier.

Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Orm;
Imports Prognoz.Platform.Interop.Rds;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    RubDesc: IMetabaseObjectDescriptor;
    RubrIn: IRubricatorInstance;
    FactsLookup: IRubricatorFactsLookup;
    MetaDLookup: IMetaDictionaryLookup;
    cond: IOrmCondition;
    FactData: IRubricatorFactData;
    i: Integer;
    fdMembers: IMetaDataMembers;
    Value: object;
Begin
    MB := Params.Metabase;
    RubDesc := MB.ItemById["FC_COMM"];
    RubrIn := RubDesc.Open(NullAs IRubricatorInstance;
    FactsLookup := RubrIn.CreateFactsLookup();
    MetaDLookup := FactsLookup.Lookup;
    cond := MetaDLookup.Where.Add();
    cond.AttributeName := "COUNTRY";
    cond.Value := 512;
    FactsLookup.Open(DictionaryCursorOptions.dcuoNone);
    FactData := FactsLookup.Current;
    If FactData <> Null Then
    fdMembers := FactData.Record.Members;
        For i := 0 To fdMembers.Count - 1 Do
            System.Diagnostics.Debug.Write(fdMembers.Item[i].Attribute.Name + ": ");
            Value := fdMembers.Item[i].Value;
            System.Diagnostics.Debug.WriteLine(value);
        End For;
    End If;
    FactsLookup.Close();
End Sub;

After executing the example search is executed by the last condition: value of the COUNTRY attribute of the factor is equal to 512. Data of the first found factor is displayed in the console window.

See also:

IRubricatorFactsLookup