Level: Integer;
Level: uinteger;
The Level property determines level of dictionary where element is searched.
If the property is set to -1, search is performed whatever the level is.
Executing the example requires that repository contains table dictionary with the DIM_SEP which consists of two levels.
Add links to the Dimensions, Metabase system assemblies.
Sub UserProc;
Var
mb: IMetabase;
instance: IDimInstance;
indexesinstance: IDimIndexesInstance;
indexinstance: IDimIndexInstance;
instlook: IDimIndexInstanceLookup;
arr, arr1: array Of Variant;
i, c: integer;
Begin
// Get repository
mb := MetabaseClass.Active;
// Get access to dictionary data
instance := mb.ItemById("DIM_SEP").Open(Null) As IDimInstance;
// Create areas for search
Arr := New Variant[1];
Arr1 := New Variant[1];
// Get collection of dictionary indexes
indexesinstance := instance.Indexes;
// Get the first dictionary index
indexinstance := indexesinstance.Item(0);
// Create object to search dictionary elements
instlook := indexinstance.CreateDimIndexLookup;
// Set level for search
instlook.Level := 2;
// Find the 1000 and 1020 elements
Arr[0] := 1000;
Arr1[0] := 1020;
// Get element sequence number
i := indexinstance.LookUp(Arr);
// Get element sequence number
c := indexinstance.LookUp(Arr1);
// Display sequence number to the console
Debug.WriteLine("Sequence number of found element = " + i.ToString);
// Display sequence number to the console
Debug.WriteLine("Sequence number of found element = " + c.ToString);
End Sub UserProc;
After executing the example the console displays sequence orders of found elements.
The requirements and result of the Fore.NET example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Dimensions;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
instance: IDimInstance;
indexesinstance: IDimIndexesInstance;
indexinstance: IDimIndexInstance;
instlook: IDimIndexInstanceLookup;
arr, arr1: array Of object;
i, c: uinteger;
Begin
// Get repository
mb := Params.Metabase;
// Get access to dictionary data
instance := mb.ItemById["DIM_SEP"].Open(Null) As IDimInstance;
// Create areas for search
Arr := New object[1];
Arr1 := New object[1];
// Get collection of dictionary indexes
indexesinstance := instance.Indexes;
// Get the first dictionary index
indexinstance := indexesinstance.Item[0];
// Create object to search dictionary elements
instlook := indexinstance.CreateDimIndexLookup();
// Set level for search
instlook.Level := 2;
// Find the 1000 and 1020 elements
Arr[0] := 1000;
Arr1[0] := 1020;
// Get element sequence number
i := indexinstance.LookUp(Arr);
// Get element sequence number
c := indexinstance.LookUp(Arr1);
// Display sequence number to the console
System.Diagnostics.Debug.WriteLine("Sequence number of found element = " + i.ToString());
// Display sequence number to the console
System.Diagnostics.Debug.WriteLine("Sequence number of found element = " + c.ToString());
End Sub;
See also: