PTextCursor

Moves the insertion point (text cursor), by the specified range.


Command constructor

PTextCursor(eTextAmt cHowMuch, long nHowMany = 1);
eTextAmt cHowMuch;
Enum eTextAmt is defined in PKeywords.h:
kTextAmtCharFor
for forward one character
kTextAmtCharBack for back one character
kTextAmtWordFor for forward one word (or punctuation mark), including trailing spaces
kTextAmtWordBack for back one word (or punctuation mark)
kTextAmtLineFor for down one line (equivalent to down arrow key)
kTextAmtLineBack for up one line (equivalent to up arrow key)
kTextAmtParaFor for forward to beginning of next paragraph
kTextAmtParaBack for back to beginning of paragraph
kTextAmtHoleFor for end of text block
kTextAmtHoleBack for back to beginning of text block
kTextAmtStoryFor for forward to end of story
kTextAmtStoryBack for back to beginning of story
kTextAmtEolFor for forward to end of line
kTextAmtEolBack for back to beginning of line
kTextAmtSentFor for forward to end of sentence (includ ing trailing spaces)
kTextAmtSentBack for back to beginning of sentence
kTextAmtRunFor for forward to end of text run
kTextAmtRunBack
for backward to start of text run
kTextAmtAll
to select entire story
long nHowMany;
Number of times the value specified in cHowMuch is to be repeated; the default is 1
PageMaker won't turn page. In layout view, PageMaker does not turn the page if you send the insertion point to a page not currently displayed. PageMaker beeps if you add or edit text on the undisplayed page.

Text selected. If text is selected when you send this command, PageMaker moves the insertion point from the ending point of the selection. The ending point can be either before the first character or after the last character of the selected range, depending upon how the text was selected: by dragging the insertion point, a Plug-in command (PSetTextCursor or PTextSelect), or double- or triple-clicking the mouse.

Out-of-range values. If cHowMuch or nHowMany exceed the limits of the story, PageMaker moves the insertion point to the beginning or end of the story, according to the direction specified. For example, if you attempt to move the insertion point forward five paragraphs

PTextCursor(kTextAmtParaFor, 5);

but only three paragraphs remain, PageMaker moves the insertion point to the end of the story.

nHowMany ignored for textblocks. If cHowMuch is kTextAmtHoleFor or kTextAmtHoleBack, PageMaker ignores the value of nHowMany and moves the insertion point to the beginning or end of the current text block.

Story editor: cHowMuch ignored if ±textblocks. While in story editor, if you set cHowMuch to kTextAmtHoleFor or kTextAmtHoleBack, PageMaker does not move the insertion point. Text blocks have no meaning in story editor.

Example. The following example moves the insertion point (text cursor) forward by 50 words.

PTextCursor(kTextAmtWordFor, 50);


See also

The PTextEnter and PTextSelect commands

The PGetTextCursor query


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

Comments or suggestions? Contact Adobe Developer Support