PageUp, PageUp()

Syntax

PageUp [Count] [Select]

PageUp([Count] [Select])

Remarks

The PageUp statement moves the insertion point or the active end of the selection (the end that moves when you press SHIFT+PAGE UP) up 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 beginning of the document, PageUp moves the insertion point or the active end of the selection to the beginning 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 down.

Select

Specifies whether to select text:

0 (zero) or omitted Text is not selected. If there is already a selection, PageUp moves the insertion point Count–1 screens above the selection.

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


The PageUp() 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 screens, even if less than Count. For example, PageUp(2) returns –1 even if a single PageUp instruction brings the beginning of the document into view.


Example

This example selects one screen up from the insertion point. If there is less than one screen above the insertion point, the message "Selected to start of document" appears in the status bar.


PageUp 1, 1
If CmpBookmarks("\StartOfSel", "\StartOfDoc") = 0 Then
    Print "Selected to start of document."
End If

See Also

EditGoTo, HPage, HScroll, PageDown, PrevPage, VPage, VScroll