PChangeNext

Searches for the next instance of the Find What text specified in the last PChange, PChangeAll, or PFind command and replaces it with the Change To text specified in the last PChange or PChangeAll commands, using all the same settings. Leaves the new text selected.


Command constructor

PChangeNext();

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

Current publication only. The PChangeNext 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 boxes, the PFind, PChange, and PChangeAll commands share the Find What and PChange To text, as well as the settings for the search options, range, and attributes. (Note: You must know all the current settings before you use the PChangeNext and PFindNext commands. If you insert a PFind command between the PChange and PChangeNext commands, the Find search-text, options, range, and attributes become the search text and settings used by PChangeNext, while the replacement text and attributes remain active from the last PChange or PChangeNext command.) For example:

PFindTypeAttr1("Any", 100, kParmAny, kFCSAttrBoldStyle + kFCSAttrUnderline, kParmAny, kParmAny);
PChangeTypeAttr1("Helvetica", 90, kParmAny, kFCAttrBoldStyle, kParmAny, kParmAny);
PChange("Note", "Tip", kFCSAllStories, 1, true, true, false);
PChangeNext(); // changes next instance of a bold underlined
// "Note" to bold, Helvetica 9-point "Tip:"
PFind("See also", kFCSCurrentStory, false, false, false, true);
PChangeNext(); // searches only from insertion point to end of story,
// changes next instance of "See also" to "Tip",
// regardless of attributes

The first PChangeNext command searches for the next instance of a 10-point, bold, underlined, whole-word "Note" and replaces it with a 9-point, Helvetica, bold word "Tip." The search begins at the position of the insertion point and wraps to the beginning of the next story if necessary.

Because of the PFind command, the second PChangeNext searches for the next instance of "See also," regardless of its capitalization or attributes. Using the same Change To criteria, it replaces "See also" with 9-point, Helvetica bold "Tip." The search begins from the location of the insertion point, but is now limited to the current story.

Exceptions. There are two common situations which will result in an exception being thrown by the constructor:

Example. The following example switches to story editor. It searches the cur rent story for the word "rumba," regardless of the capitalization or attribute settings and replaces the first match it finds with the word "cha-cha." The search begins at the position of the insertion point and wraps to the beginning of the story if necessary. The PChangeNext command then replaces the next instance of "rumba," using the same search criteria and starting the search from the end of the last encountered "rumba."

PEditStory(); // switch to story editor
PChange("rumba", "cha-cha", kFCSCurrentStory, kFCWrap, kFCAnyCase, kFCWholeWord, kFCClear);
PChangeNext();


See also

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

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

Adobe PageMaker 6.5 Help > Commands > Utilities > Change


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

Comments or suggestions? Contact Adobe Developer Support