Syntax
ParaUp [Count] [, Select]
ParaUp([Count] [, Select])
Remarks
The ParaUp statement moves the insertion point or the active end of the selection (the end that moves when you press CTRL+SHIFT+UP ARROW (Windows) or COMMAND+SHIFT+UP ARROW (Macintosh)) up by the specified number of paragraphs.
If the insertion point is at the beginning of a paragraph, the instruction ParaUp moves the insertion point to the beginning of the previous paragraph. If the insertion point is not at the beginning of the paragraph, or if there is a selection, ParaUp moves the insertion point to the beginning of the current paragraph. If the current selection extends over multiple paragraphs, the instruction ParaUp moves the insertion point to the beginning of the first selected paragraph.
Argument | Explanation | |
Count | The number of paragraphs to move; if omitted, 1 is assumed. Negative values move the insertion point or the active end of the selection down. | |
Select | Specifies whether to select text: 0 (zero) or omitted Text is not selected. If there is already a selection, ParaUp moves the insertion point Count–1 paragraphs above the selection. Nonzero Text is selected. If there is already a selection, ParaUp moves the active end of the selection toward the beginning of the document. In a typical selection made from left to right, where the active end of the selection is closer to the end of the document, ParaUp shrinks the selection. In a selection made from right to left, it extends the selection. |
The ParaUp() function behaves the same as the statement and also returns the following values.
Value | Explanation | |
0 (zero) | If the insertion point or the active end of the selection cannot be moved up. | |
–1 | If the insertion point or the active end of the selection is moved up by any number of paragraphs, even if less than Count. For example, ParaUp(2) returns –1 even if the insertion point is at the end of the first paragraph in the document. |
Example
This example finds the next occurrence of the phrase "Press F1 for Help" and then selects the entire text of the surrounding paragraph:
EditFind .Find = "Press F1 for Help" ParaUp ParaDown 1, 1
Note that you can also use the predefined bookmark "\Para" in the instruction EditGoTo "\Para" to select the paragraph containing the insertion point or selection. For more information on predefined bookmarks, see "Operators and Predefined Bookmarks" later in this part.
See Also
LineUp, PageUp, ParaDown