op.find

Syntax op.find (string)

Params string is the string of characters to be found in the target outline window.

Action Selects the first occurrence of string if it finds the text in the outline. Whether the find operation wraps around (that is, continues from the bottom of the outline if string is not found before the end of the window is reached) is determined by

settings in the search.params table.

Returns True if the text in string is found, false otherwise. Also returns false if the front window is not an outline window.

Examples Make sure that examples.Sample Outline 2 is the frontmost window and then execute:
op.find ("1.3")


   » true

The text "1.3" in "Subhead 1.3" will be highlighted. You may wish to find the text and then return a message containing the heading in which it is found. You can do this as shown here.

Be sure that examples.Sample Outline 2 is the frontmost window and then execute:
op.find ("1.3");

msg (op.getLineText () )


   » true

The main Frontier window will display "Subhead 1.3."

With examples.Sample Outline 1 as the frontmost window, execute:
op.find ("1.3")


   » false

The string was not found in the frontmost outline window.

Notes The case-sensitivity of the find operation is set in search.params.

When the sought-for text is located, the bar cursor is placed on the line in which the text was found.

If the selection is the only occurrence of string, op.find returns false and leaves the selection unchanged.

See Also op.setLineText

op.getLineText

Discuss