PageDown, PageDown()

Syntax

PageDown [Count] [Select]

PageDown([Count] [Select])

Remarks

The PageDown statement moves the insertion point or the active end of the selection (the end that moves when you press SHIFT+PAGE DOWN) down by the specified number of screens, where one screen is equal to the height of the active window. If there is not a full screen between the insertion point or the selection and the end of the document, PageDown moves the insertion point or the active end of the selection to the end of the document.

Argument

Explanation

Count

The number of screens 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, PageDown moves the insertion point Count–1 screens below the selection.

Nonzero Text is selected. If there is already a selection, PageDown 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, PageDown extends the selection. In a selection made from right to left, it shrinks the selection.


The PageDown() 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 screens, even if less than Count. For example, PageDown(2) returns –1 even if the insertion point is only one screen from the end of the document.


Examples

This example extends the selection down two screens from the insertion point:


PageDown 2, 1

The following example counts the number of screens between the insertion point and the end of the document. The PageDown() function is used to detect when the end of the document is reached.


n = 0
While PageDown()
    n = n + 1
Wend
MsgBox "Number of screens:" + Str$(n)

See Also

EditGoTo, HPage, HScroll, NextPage, PageUp, VPage, VScroll