FIX: _CUROBJ Works Improperly in WHEN Clause with LEFT ARROW

Last reviewed: September 22, 1997
Article 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 "{home}" 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 kbprg
Version : 2.5x 2.6x | 2.00 2.5x 2.6x
Platform : MS-DOS WINDOWS
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.