Find(Info: IMetabaseObjectFindInfo): IMetabaseObjectDescriptors;
Info. Information to search repository object.
The Find method searches object (objects) corresponding to search conditions.
The method returns an empty collection of descriptions, if none object is found.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
MDescs: IMetabaseObjectDescriptors;
MDesc: IMetabaseObjectDescriptor;
FInfo: IMetabaseObjectFindInfo;
Begin
MB := MetabaseClass.Active;
FInfo := MB.CreateFindInfo;
FInfo.Text := "OBJTEST";
FInfo.Attribute := FindAttribute.NameOrIdent;
FInfo.WholeWordsOnly := False;
MDescs := MB.Find(FInfo);
If MDescs.Count <> 0 Then
For Each MDesc In MDescs Do
Debug.WriteLine("Identifier: " + MDesc.Id + "; Name: " + MDesc.Name);
End For;
Else
Debug.WriteLine("Objects are not found.");
End If;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Metabase;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MDescs: IMetabaseObjectDescriptors;
MDesc: IMetabaseObjectDescriptor;
FInfo: IMetabaseObjectFindInfo;
Begin
MB := Params.Metabase;
FInfo := MB.CreateFindInfo();
FInfo.Text := "OBJTEST";
FInfo.Attribute := FindAttribute.fnaNameOrIdent;
FInfo.WholeWordsOnly := False;
MDescs := MB.Find(FInfo);
If MDescs.Count <> 0 Then
For Each MDesc In MDescs Do
System.Diagnostics.Debug.WriteLine("Identifier: " + MDesc.Id + "; Name: " + MDesc.Name);
End For;
Else
System.Diagnostics.Debug.WriteLine("Objects are not found.");
End If;
End Sub;
After executing the example all objects containing in the name or in the identifier the OBJTEST text are searched. Names and identifiers of the found objects are displayed in the development environment console.
See also: