![]() |
![]() |
PSetTextCursor(unsigned long nStoryID, long nBegin, long nEnd);
Count of non-printing characters. Include inline graphics and non-printing characters (such as index markers, tabs, and returns) in nBegin and nEnd.unsigned long nStoryID;
Identifier for story (value ignored if in story editor)
kParmDontCare to select text in story currently containing the insertion pointlong nBegin;
Starting location for text selection, in characters from beginning of story (0 sets insertion point prior to first character in story)long nEnd;
Ending location of text selection, in characters from beginning of story (if nBegin equals nEnd, the cursor remains in that location)
Getting the story ID. To get the identifier for the story (as a value for nStoryID), use the PGetTextRun, PGetTextCursor, or PGetStoryIDList queries.
Story editor. When in story editor, PageMaker ignores nStoryID and selects text in the current story, scrolling the screen as necessary.
Unplaced text. When layout view is active, PageMaker displays an error message if the values for nBegin or nEnd would position the insertion point in unplaced text i.e., (text in a story that has not been placed on the page or pasteboard).
Selection direction irrelevant. The PSetTextCursor command does not record the direction in which you select text. The end of the selection is always the last (right-most) character. For example, PageMaker selects the same characters using either of the following lines:
PSetTextCursor(-2, 3, 7); PTextSelect(kTextAmtCharFor);
PSetTextCursor(-2, 7, 3); PTextSelect(kTextAmtCharFor);
Warning. Use the PTextCursor
command, not PSetTextCursor, to move the cursor to the end of a story. If
the PSetTextCursor parameters nBegin and nEnd are both equal to the number
of characters in the story, PageMaker returns an error and removes the insertion
point from the story.
Value out of range. If nEnd exceeds the number of characters in the story, PageMaker selects text from nBegin to the end of the story. If nBegin exceeds the number of characters in the story, PageMaker selects text from the end of the story back to nEnd. If both nEnd and nBegin are in overset text, the command fails.
Example. The following example selects the characters between the fifth and tenth characters in the story with the PageMaker ID "3".
PSetTextCursor(3, 5, 10);
The PGetTextLocation, PGetTextRun, PGetTextCursor, and PGetStoryIDList queries
Comments or suggestions? Contact Adobe Developer Support