PFindNext

Searches for the next instance of the text specified in the last PFind, PChange, or PChangeAll command, using all the same settings. Selects the first match of the search text it encounters.


Command constructor

PFindNext();

Story editor only. The PFindNext command works only in story editor.

Current publication only. Unlike the Find Next button in the Find dialog box, the PFindNext command cannot search multiple publications. It can search only the stories in the currently active publication.

Repeat as often as needed. You can send this command repeatedly until PageMaker finishes searching the range specified by the previous PFind, PChange, or PChangeAll command.

Last executed PChange, PChangeAll, or PFind wins. As in the Find and Change dialog box, the PFind, PChange, and PChangeAll commands share the Find What and Change To text, as well as the settings for the search options, range, and attributes. Therefore, you must be careful to know all the current settings before you use the PChangeNext and PFindNext commands. (If you insert a Change command between the Find and PFindNext commands, the Change search text, options, range, and attributes become the search text and settings used by PFindNext.) For example:

PFindTypeAttr1("Any", 10, -3, boldstyle+underline, -3, -3);
PChangeTypeAttr1("Helvetica", 9, -3, boldstyle, -3, -3);
PFind("Tip", kFCSCurrentStory, false, true, true, false);
PFindNext();
// finds next instance of a bold underlined "Tip"
// searches only from insertion point to end of story,
PChange("Note", "Tip", kFCSAllStories, true, false, false);
PClear();
PFindNext();
// finds next instance of "Note",
// regardless of attributes, searching all stories

The first PFindNext command searches for the next instance of a 10-point, bold and underlined "Tip," matching the whole word and its capitalization. The search begins at the location of the insertion point and stops at the end of the story.

Because of the PChange command, the second PFindNext searches for the next instance of "Note," regardless of its capitalization or attributes. The search begins from the location of the insertion point, but wraps to the next story if necessary.

Scripts palette. Do not use the PFindNext command in scripts you plan to run using the Scripts palette. When PageMaker finds no match or completes the search, the Scripts palette interprets this as an error and stops at that point in the script.

Exceptions. If no match is found, PFindNext throws a CQ_SEARCH_STATUS exception. If the story editor is not active, it throws a CQ_LO_INVALID_MODE exception.

Example. The following example searches the current story for the first instance of the letters "tango," regardless of the capitalization or attribute settings (paragraph style, font, size, type style, position, or case). The search begins at the position of the insertion point and wraps to the beginning of the story if necessary. The PFindNext command then searches for the next instance of "tango," using the same search criteria and starting the search from the end of the last encountered "tango."

PFind("tango", kFCSCurrentStory, true, false, false, true);
PFindNext();


See also

The PChange, PChangeAll, PChangeNext, PChangeParaAttr, PChangeTypeAttr1, PChangeTypeAttr2, PChangeWindow, PFind, PFindParaAttr, PFindTypeAttr1, PFindTypeAttr2, and PFindWindow commands

The PGetChangeParaAttr, PGetChangeTypeAttr1, PGetChangeTypeAttr2, PGetChangeWindow, PGetFindParaAttr, PGetFindTypeAttr1, PGetFindTypeAttr2, and PGetFindWindow queries

Adobe PageMaker 6.5 Help > Commands > Utilities > Find Next


Copyright © 1996, Adobe Systems Incorporated. All rights reserved.

Comments or suggestions? Contact Adobe Developer Support