DtEditorChange(3) — Subroutines
NAME
DtEditorChange − change one or all occurrences of a string in a DtEditor widget
SYNOPSIS
#include <Dt/Editor.h>
BooleanDtEditorChange(Widget widget,
char ∗ find,
char ∗ change,
unsigned int instanceToChange);
DESCRIPTION
The DtEditorChange() function replaces either the next occurrence of a string, all occurrences of the string, or the currently selected text in a DtEditor widget with a replacement string. The string to search for and the value to change it to are either passed as arguments to DtEditorChange(), or are the last values entered in the Find/Change Dialog (see DtEditorInvokeFindChangeDialog(3)).
The widget argument specifies the DtEditor widget ID.
The find argument specifies the string to change. If the instanceToChange argument is DtEDITOR_CURRENT_SELECTION, find is ignored. If find is NULL and instanceToChange is equal to DtEDITOR_NEXT_OCCURRENCE, or DtEDITOR_ALL_OCCURRENCES, DtEditorChange() uses the last string specified in the Find field of the Find/Change dialog. If the string is not found by the time the end of the document is reached, the search continues at the beginning of the document.
The changeTo argument specifies the replacement value for the find string. If find is NULL, DtEditorChange() uses the last string specified in the Change To field of the Find/Change dialog.
If the instanceToChange argument is set to DtEDITOR_NEXT_OCCURRENCE, DtEditorChange() replaces the next occurrence (relative to the insertion cursor) of the find string. If set to DtEDITOR_ALL_OCCURRENCES, all instances of the find string are changed. If set to DtEDITOR_CURRENT_SELECTION, the find argument is ignored and the currently selected text is replaced.
For a complete definition of the DtEditor widget and its associated resources, see DtEditor(3).
RETURN VALUE
Upon successful completion, the DtEditorChange() function returns True if the substitution occurred; otherwise, it returns False.
SEE ALSO
DtEditor(5), DtEditor(3), DtEditorFind(3), DtEditorInvokeFindChangeDialog(3).
— 2 August 1994