Condition Edit/Filter String Edit

Use this dialog box to create conditions or filters for terminating the fetching of data from recordsets and for executing operations. Select entries from the Variables, Entity attributes, or Recordset fields list to build string expressions in the Condition/Filter String box. Use the condition operand buttons to create your string or type the string directly into the box.

To reference attributes, fields, and variables, use the following syntax:

For example, create the following condition that addresses cursor syncing when the cursor is expected to arrive at one of two possible locations:

(Variables.CursorRow = 5 And Variables.CursorColumn =27)

-or-

(Variables.CursorRow = 24 And Variables.CursorColumn =1)

The following condition operands are supported by the Host Integrator:

= Equal to
=* Equal to (without being case-sensitive)
<> Not equal to
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to
=~ The regular expression matches the value expression. For example, object =~/[0-9]+/ means that object is numeric. See How to use regular expressions in Host Integrator for more information.
!~ The regular expression does not match the value expression.
And And
Or Or
Not Not
( Left parenthesis
) Right parenthesis
+ Add
- Subtract
* Multiply
/ Divided by

Certain Host Integrator API methods use filter expressions as arguments (for example, see the FetchRecords and SelectRecordByFilter methods in the Visual Basic Methods Reference). See the Host Integrator API Reference for more information about the connectors. To view an example of creating a filter string, see the documentation for using the Select Record action in the Test Recordset dialog box.

Notes:

Using Regular Expressions

A regular expression is a pattern that can match various text strings; for example, l[0-9]+ matches l followed by one or more digits.

Syntax for pattern matching

<ValueExp> =~ [m]/<RegEx>/[i][m]
<ValueExp> !~ [m]/<RegEx>/[i][m]
<ValueExp> =~ s/<RegEx>/<ReplaceWith>/[g][i][m]

where

m This is the "Match" operator. It means read the input string expression (on the left of the =~ or !~ operator), and see if any part of it matches the expression within the delimiters following the m. The =~ operator means return boolean true if there is a match; the !~ operator means the opposite
s/ "Search and replace" or "substitution" operator. In the input string (to the left of the =~ operator), the regular expression match is replaced. When the regular expression uses parentheses, backreferences (such as $1) can be used in the ReplaceWith string. The output is the result after replacements.
/i Ignore case option for case-insensitive pattern matching.
/g Global option. Replaces all regex matches in the string, not just the first one.
/m Multi-line option. Within the regular expression, caret (^) and dollar ($) match the beginning and end of lines respectively within the string.

If your regular expression or replacement value contains the forward slash character (/), you can use a different delimiter symbol (such as !).

Example

You can set up an expression to terminate a recordset where the last screen is identified by text on the screen stating the current page and the total number of pages, such as "Page 1 of 12" or "Page 12 of 12".

To terminate the recordset, define an attribute called PageStatus at the screen location where the "Page x of y" text occurs. In the Recordset Termination dialog, define the following termination condition:

PageStatus =~ s/Page ([0-9]+) of [0-9]+/$1/ = PageStatus =~ s/Page [0-9]+ of ([0-9]+)/$1/(

Related Topics
Bullet How to use regular expressions in Host Integrator
Bullet How to configure a variable
Bullet Select record