Microsoft KB Archive/99549

{| = FIX: _CUROBJ Works Improperly in WHEN Clause with LEFT ARROW =
 * width="100%"|

ID: Q99549

2.5x 2.6x | 2.00 2.5x 2.6x

WINDOWS  | MS-DOS kbprg kbfixlist kbbuglist The information in this article applies to:


 * Microsoft FoxPro for Windows, versions 2.5, 2.5a
 * Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a

SYMPTOMS
The variable _CUROBJ does not return the cursor to the beginning of a GET field when it is used in the WHEN clause or the VALID clause of the GET field and the LEFT ARROW key is pressed. This puts the cursor at the far right of the field instead of the far left.

The expected behavior is that the cursor would be placed at the beginning of the field regardless of whether the user pressed the ENTER, UP ARROW, DOWN ARROW, RIGHT ARROW, or LEFT ARROW key. For example, if the following line is placed in the WHEN or VALID clause

_CUROBJ=_CUROBJ+1 and if the LEFT ARROW key is used to move to another field, the cursor is then placed at the far right of the field.

WORKAROUND
To work around this behavior, do one of the following:

  Include the KEYBOARD &quot;{home}&quot; command in the WHEN clause or VALID clause. This command will always return the cursor to the far left regardless of what key is pressed. NOTE: This solution works only if the Select Field On Entry check box is selected. -or-   Place the following code in the WHEN clause to return the cursor to the beginning of the field: KEYBOARD '{SHIFT+LEFTARROW}' KEYBOARD '{RIGHTARROW}' KEYBOARD '{HOME}' NOTE: This solution works only if the Select Field On Entry check box is cleared (not selected). 

STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual FoxPro 3.0 for Windows.

Additional reference words: VFoxWin fixlist3.00 FoxDos FoxWin 2.00 2.50 2.50a 2.50b 2.60 2.60a buglist2.50 buglist2.50a buglist2.50b buglist2.60 buglist2.60a curobj KBCategory: kbprg kbfixlist kbbuglist KBSubcategory: FxprgGeneral

Keywords         : FxprgGeneral kbbuglist kbfixlist Version          : 2.5x 2.6x | 2.00 2.5x 2.6x Platform         : MS-DOS WINDOWS Solution Type    : kbfix
 * }