TXFIND directive

Finds a subtext within a text structure.


Options

CASE = string
Whether to treat the case of letters (small or capital) as significant when searching for the SUBTEXT within the TEXT (significant, ignored); default sign

REVERSE = string
Whether to reverse the search to work from the end of the TEXT (yes, no); default no

MULTISPACES = string
Whether to treat differences between multiple spaces and single spaces as significant, or to treat them all like a single space (significant, ignored); default sign

DISTINCT = strings
Whether to require the SUBTEXT to have one or more separators to its left or right within the TEXT (left, right; default *

SEPARATOR = text
Characters to use as separators; default ' ,;:.'


Parameters

TEXT = texts
Texts to be searched

SUBTEXT = texts
Text to look for in each TEXT

COLUMN = scalars
Position of the column within TEXT where the first character of SUBTEXT has been found

LINE = scalars
Number of the line within TEXT where the first character of SUBTEXT has been found

ICOLUMN = scalars
Column within TEXT at which to start the search

ILINE = scalars
Line within TEXT at which to start the search


Description

The TXFIND directive looks for a GenStat text structure within another text structure. The text to search is specified by the TEXT parameter, and the SUBTEXT parameter specifies the text to be found. The search treats the two texts as if they were paragraphs of characters: that is, it takes no account of the line breaks within the two text structures, replacing each one with a space. The COLUMN parameter saves the column within the TEXT where the first character of the SUBTEXT is found, and the LINE parameter saves its line within the TEXT. These are both set to zero if SUBTEXT is not found. You can use the ICOLUMN and ILINE parameters to specify a starting column and line for the search. So you can search for the next occurrence of SUBTEXT by setting ILINE to the saved value of LINE, and ICOLUMN to the saved value of COLUMN plus one.

   TXFIND usually takes account of the case of letters (small or capital) when looking for the SUBTEXT within the TEXT. So for example 'GenStat' would not match with 'Genstat'. However, you can set option CASE=ignored to ignore differences in case. It will usually also treat multiple spaces as significant, but you can set option MULTISPACE=ignored to treat them all like a single space.

   Option DISTINCT is useful if you are looking for distinct words or phrases. The left setting requires the SUBTEXT to begin either at the start of the TEXT, or to be preceded in the TEXT by a separator (such as a space or comma). Similarly, the right setting requires the SUBTEXT to end within the TEXT with a separator (or to be at the end of the TEXT). The separators are specified by the SEPARATOR option.

 

Options: CASE, REVERSE, MULTISPACES, DISTINCT, SEPARATOR.

Parameters: TEXT, SUBTEXT, COLUMN, LINE, ICOLUMN, ILINE.


Action with RESTRICT

Any restrictions are ignored.