GetItems(Keys: Array): IMetabaseObjectDescriptors;
GetItems(Keys: System.Array): Prognoz.Platform.Interop.Metabase.IMetabaseObjectDescriptors;
Keys is an integer array, containing objects keys.
The GetItems method returns the collection of description of the objects, which keys are passed by the Keys parameter.
Only existing objects are included in the collection. If an object with any key is not found, this key is skipped. And the exception error is not generated.
To execute the example, add a link to the Metabase system assembly.
Sub UserProc;
Var
mb: IMetabase;
key: Array[2] Of Integer;
MDescs: IMetabaseObjectDescriptors;
Desc: IMetabaseObjectDescriptor;
i: Integer;
Begin
mb := MetabaseClass.Active;
key[0] := 5781;
key[1] := 5782;
MDescs := mb.GetItems(key);
For i := 0 To MDescs.Count - 1 Do
Desc := MDescs.Item(i);
Debug.WriteLine("Identifier: " + Desc.Id + "; Name: " + Desc.Name);
End For;
End Sub UserProc;
After executing the example the console window will show identifiers and names corresponding to the objects with set keys.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Metabase;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
key: Array[2] Of Integer;
MDescs: IMetabaseObjectDescriptors;
Desc: IMetabaseObjectDescriptor;
i: Integer;
Begin
mb := Params.Metabase;
key[0] := 5781;
key[1] := 5782;
MDescs := mb.GetItems(key);
For i := 0 To MDescs.Count - 1 Do
Desc := MDescs.Item[i];
System.Diagnostics.Debug.WriteLine("Identifier: " + Desc.Id + "; Name: " + Desc.Name);
End For;
End Sub;
See also: