LocatePositionSave

LocatePositionSave creates a restore point for the current word position of the locate pointer.

Syntax

bool LocatePositionSave () 

Parameters

Smart parameters are supported.

Returns

False if called on the wrong level or if the COO does not exist. Otherwise, True.

Level

Page or field level.

Details

LocatePositionSave creates a restore point for the current word position of the locate pointer. After calling additional locate actions that change the word location of locate pointer, the previously saved position can be restored using the LocatePositionRestore action.

Using LocatePositionSave and LocatePositionRestore together provides an efficient way to reset the position to a located word, when the subsequent locate actions have moved the pointer to a located word. For example, when rules need to look for text in multiple directions based on a found word, these actions efficiently reset the internal locate pointer to a saved position instead of performing the original locate action a second time, which can require more processing time.

Example

This example shows two functions. The first performs a locate, saves the location, moves to the right and tests the word. If the word does not match the IsNumber criteria, then control falls to the next function which restores the saved locate position to the word found in the previous FindKeyList action and then looks in a different direction for a numeric value. Alternatively, the second function could call FindKeyList again, but the action to restore the last position is much more efficient.
Key List Right 1 Function
+ FindKeyList("InvNum")
+ LocatePositionSave()
+ GoRightWord("1")
+ IsNumber("60")
+ UpdateField()
Key List Down 1 Function
+ LocatePositionRestore()
+ GoBelowWord("1")
+ IsNumber("60")
+ UpdateField()