IRdsAttributesList.Probe

Syntax

Probe: IDimSimpleAttrProbe;

Description

The Probe property returns attributes collection implemented by the IDimSimpleAttrProbe interface.

Comments

This property returns an object that should check attributes, by which values search is executed. This property use enables the user to avoid custom implementation of the IDimSimpleAttrProbe.Probe method. The method returns True for attributes included in the current collection, it returns False for all other attributes.

Example

Executing the example requires a form with the Button1 button, the RdsDictionaryBox component named RdsDictionaryBox1, and the UiRdsDictionary component that is a data source for RdsDictionaryBox1. The MDM dictionary that is connected to the UiRdsDictionary component has the attributes Name and UserAttr.

    Sub Button10OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        RdsInst: IRdsDictionaryInstance;
        Search: IRdsDictionaryElementsSearch;
        AttrsList: IRdsAttributesList;
        Crit: IDimTextCriteria;
        Keys: IRdsDictionaryElementArray;
    Begin
        RdsInst := RdsDictionaryBox1.Source.Instance;
        Search := RdsInst.CreateSearch;
        AttrsList := Search.Attributes;
        //Specify attributes in the collection
        AttrsList.Attributes := "Name;Key";
        Crit := New DimTextCriteria.Create;
        //Determine attributes using the Probe method
        Crit.CriteriaOptions := TextCriteriaOptions.SearchProbeAttributes
            Or TextCriteriaOptions.FreeText;
        //Specify object that should determine attributes for the search
        //The method returns True for the Name and Key attributes because they are included in the collection
        Crit.SimpleProbe := AttrsList.Probe;
        Crit.Text := "401";
        Search.SetTextCriteria(Crit);
        Keys := Search.FindAll;
    End Sub Button10OnClick;

After executing the example, pressing the button creates an object for searching MDM dictionary elements. The condition, according to which search should be executed, is set. The Probe method is used to determine attributes, by which values search should be executed. System object received on the basis of the attributes collection that is contained in the AttrsList variable is used as an object which executes check. Array of found elements keys is contained in the Keys variable after the search.

See also:

IRdsAttributesList