PTextSelect

Selects text from the position of the insertion point forward or back by the selected range. If text is currently selected, it extends the selection or deselects text, depending upon the direction specified.


Command constructor

PTextSelect(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 value specified in cHowMuch is to be repeated; the default is 1
Command works like PageMaker interface. The PTextSelect command works the same way as selecting text using the mouse or the keyboard. The insertion point serves as an anchor point for the selection. You can select forward or back from that point, but you cannot select text on one side of the insertion point and extend that selection to the other side of the insertion point.

Extending the selection. If text is already selected, PageMaker extends the selection or deselects text depending on both the direction of cHowMuch and the direction the insertion point was originally moved from the anchor point when the text was first selected.

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 extends the selection forward to the end of the current line and then to the end of the following three lines.

PTextSelect(kTextAmtEolFor, 3);


See also

The PSetTextCursor command

The PGetTextCursor and PGetTextRun queries


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

Comments or suggestions? Contact Adobe Developer Support