The SearchText function (Static Text element) is an exception. This function willaddsearch words to those already specified on the Static Text tab.
The additional constraints entered in the Advanced pre-search relations pane may only refer to elements located above the current element in the FlexiLayout tree. The only exception are the subelements of the same Repeating Group element, which may refer to previous instances of subelements located in the same group below the given element.
Examples
Specifying different values for the same parameter
Specifying different values for the same parameter
Sometimes you will need to assign different values to one and the same parameter. This can be done by using the “if… then” operator:if Element1.IsNull then {
MaxErrors: 3, 0.25;
} else {
MaxErrors: 5, 0.5;
}
MaxErrors: 3, 0.25;
} else {
MaxErrors: 5, 0.5;
}
Limiting the search area
Limiting the search area
The search area may be specified by using any of the types which define an image area: Rect, RectArray, Region. It can also be specified by using an expression which returns any of these types. The result of calculating the expression is passed as an argument to the RestrictSearchArea() function:a.RestrictSearchArea( Rect(Rect( Page( 1 ).RectGlobal.Left, Page( 1 ).RectGlobal.Top+20*mm, Element1.Left.Start, Element2.Ycenter.Start ) );b.let rect1 = Element1.Rect;
let rect2 = Element2.Rect;
RestrictSearchArea( rect1 or rect2 );
let rect2 = Element2.Rect;
RestrictSearchArea( rect1 or rect2 );
Canceling the search for an object
Canceling the search for an object
For some documents, the presence of one object on the image automatically excludes another object. In still other cases, you may wish to look for a particular object only if certain conditions have been met. You can tell the program not to look for a specific object by using the DontFind() command. Once the command is executed, the program will formulate a null hypotheses for the corresponding object:if Element1.IsNull() then DontFind()
Selecting a hypothesis
Selecting a hypothesis
Sometimes several image objects meet the conditions specified in an element. This means that the program will formulate several hypotheses. If you need to select from this set only the hypothesis that is located closest to some other object or point on the image, you can use the Nearest, NearestX, and NearestY functions:
- Nearest( [name of element] ) - sets the name of the closest element.
- Nearest( x1, y1 ) - sets the coordinates of the closest point.
- NearestX( x1 ) - sets the X coordinate of the closes vertical line.
- NearestY( y1 ) - sets the Y coordinate of the closest horizontal line.
for multi-page documents
for multi-page documents
The program treats a multi-page document as a single entity and can look for an element of a multi-page document without reference to an exact page.For example:a. To specify that an element may be found in the bottom half of any page:Below: PageRect.Top + PageRect.Height / 2;(see the description of the PageRect function for details)b. To specify that an element is located on the last page of a document (you can write this code only in the principal part of the FlexiLayout, after the Header and Footer elements, if any):RestrictSearchArea( Page( PagesCount ).RectGlobal );c. To specify that an element is located on the page where an element named SearchElements.OtherElement begins:if SearchElements.OtherElement.IsFound then RestrictSearchArea( WholePage, SearchElements.OtherElement.Pages.Start );d. To specify that an element may be located on each page below the instances of the hypotheses for a repeating group named SearchElements.RepeatableGroup:Below: SearchElements.RepeatableGroup.AllInstances.PageAreaGlobal( PageNumber ).Region.Bottom;e. To specify that an element may be located on each page below the body of each subtable of a table named SearchElements.Table:Below: SearchElements.Table.AllSubTables.Body.PageAreaGlobal( PageNumber ).Bottom;
