Create results for a group field Script Locator

You can create results for a group field by following these steps:

  1. Define where the pLocator comes from using the following example:
    Dim pLocator As ICscXDocField
    Set pLocator = pXDoc.Locators.ItemByName(<Name of Script Locator>)
  2. Add one or more alternatives as follows:
    pLocator.Alternatives.AddNew
  3. In combination with additional logic, use the results from other locators to create the required values within the Script Locator. Retrieve results from other locators as follows:
    pXDoc.Locators.ItemByName(<Locator Name>).Alternatives(<N>).Text

    This example retrieves the alternative with index N from a locator producing multiple single-result alternatives, such as a Format Locator.

    pXDoc.Locators.ItemByName(<Locator Name>).Alternatives(<N>).Subfields.ItemByName(<Subfield Name>).Text

    This example retrieves a subfield result from a locator producing multiple subfields per alternative, such as an Advanced Zone Locator.

  4. Assign text values to the Script Locator subfields.
    pLocator.Alternatives(<N>).Subfields.ItemByName(<Subfield Name>).Text = <TextValue>
  5. Assign confidence values (between 0 and 1) to the Script Locator subfields.
    pLocator.Alternatives(<N>).Subfields.ItemByName(<Subfield Name>).Confidence = <ConfidenceValue>
  6. If required, assign co-ordinate values (in pixels) to the alternatives in the Script Locator subfields.
    pLocator.Alternatives(<N>).Subfields.ItemByName(<Subfield Name>).Top = <Top Coordinate>
    pLocator.Alternatives(<N>).Subfields.ItemByName(<Subfield Name>).Left = <Left Coordinate>
    pLocator.Alternatives(<N>).Subfields.ItemByName(<Subfield Name>).Height = <Height>
    pLocator.Alternatives(<N>).Subfields.ItemByName(<Subfield Name>).Width = <Width>