wp.go

Syntax wp.go (direction, count)

Params direction is a valid Frontier direction from this list: up, down, left, right.

count is a number indicating the number of times the cursor is to be moved in direction.

Action Moves the cursor in the target word processing document in the indicated direction, count times.

Returns True if the cursor was moved at all, false otherwise.

Examples edit (@examples.wpTester);
wp.setSelect (0, 0);
wp.go (down, 5)

   » true

Using wp.setSelect (0, 0) ensures the cursor position starts out at the top left position in the document. Activate the word processing window and notice where the cursor is blinking. It should be at the left margin on the fifth line of the document
(which says "original condition"). Now type and execute:

   » wp.go (left, 3)

true

edit (@examples.wpTester);
wp.setSelect (0, 0);
wp.go (down, infinity)

   » true

Activate the word processing window and notice that the cursor is at the bottom of the document, at the left margin.

Errors Attempting to move in any direction but right when the cursor cannot move in that direction because it has reached a boundary returns false but is not an error.

Notes Vertical motion always maintains relative horizontal position of the cursor unless to do so would move the cursor past the rightmost character on a line, in which case it positions the cursor at that horizontal position.

If necessary, the word processing document scrolls to make the cursor visible.

wp.go has the same effect as pressing the cursor key corresponding to direction, repeating the key press count times. So right and left mean "forward" and "backward," respectively. When the cursor wraps from one line to the next, movement may not appear

to be left or right.

Discuss