Function | Package: cg | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 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-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version