Function | Package: cg | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version

## string-search

Arguments: text-edit-pane string &key backward case-sensitive (select t) (lines-of-padding 0)

Searches for the next occurrence of a string in a text control, starting from the current text cursor position. If the string is found, then the index of the first character in the match is returned; otherwise `nil` is returned.

The arguments are:

- text-edit-pane is the `text-edit-pane` or `rich-edit-pane` to search.
- string is the Lisp string to find in the window's text.
- backward: if true, then the search is done toward the beginning of the buffer, starting from the character just before the current text cursor position. Otherwise the search is done toward the end of the buffer, starting from the character just after the current text cursor position. The default is `nil`, meaning do a forward search.
- case-sensitive: if true, then a case-sensitive search is done; otherwise a case-insensitive search is done. The default is `nil` meaning do a case-insensitive search.
- select: if true (the default) and a match is found, then the match is selected. Otherwise the text cursor is not moved, and the match position or `nil` is simply returned as usual.
- lines-of-padding: when a string match is selected, the window will be scrolled as needed so that at least this many lines of text are visible both above and below the string match (when possible). This allows the user to see additional context around the string match. The value should be a non-negative integer, and the default is zero.

To ask the user interactively for the search string, it may be useful to call ask-user-for-string or pop-up-string-dialog.

Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version