Syntax
ParaDown [Count] [, Select]
ParaDown([Count] [, Select])
Remarks
The ParaDown statement moves the insertion point or the active end of the selection (the end that moves when you press CTRL+SHIFT+DOWN ARROW (Windows) or COMMAND+SHIFT+DOWN ARROW (Macintosh)) down by the specified number of paragraphs.
Regardless of the position of the insertion point within a paragraph or whether there is a selection within a paragraph, the instruction ParaDown moves the insertion point to the start of the next paragraph. The only exception is when the insertion point is in the last paragraph of the document; in that case, ParaDown moves the insertion point to the end of the paragraph. If the current selection extends over multiple paragraphs, the instruction ParaDown moves the insertion point to the beginning of the first paragraph following the end of the selection.
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 up. | |
Select | Specifies whether to select text: 0 (zero) or omitted Text is not selected. If there is already a selection, ParaDown moves the insertion point Count paragraphs below the selection. Nonzero Text is selected. If there is already a selection, ParaDown moves the active end of the selection toward the end 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, ParaDown extends the selection. In a selection made from right to left, it shrinks the selection. |
The ParaDown() 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 down. | |
–1 | If the insertion point or the active end of the selection is moved down by any number of paragraphs, even if less than Count. For example, ParaDown(2) returns –1 even if the insertion point is at the beginning of the last paragraph in the document. |
Example
This example inserts three asterisks (***) before each paragraph in the document. Because the While ParaDown() instruction eventually moves the insertion point to the end of the last paragraph, where the asterisks are not appropriate, the If control structure uses CmpBookmarks() to detect that condition and exit the While¼Wend loop.
StartOfDocument Insert "***" While ParaDown() If CmpBookmarks("\Sel", "\EndOfDoc") <> 0 Then Insert "***" End If Wend
See Also
LineDown, PageDown, ParaUp