Knowledge Base

BUG: Incorrect Return Value with CAPSLOCK() or NUMLOCK()

Article ID: 113174

Article Last Modified on 5/6/2003


APPLIES TO


This article was previously published under Q113174

SYMPTOMS

The logical result of an operation involving the NUMLOCK() and CAPSLOCK() functions incorrectly returns a FALSE value when either function is used with the logical expression operator and the second expression returns TRUE.

RESOLUTION

To work around this behavior, you must use a nested IF statement if you are going to use the result of either NUMLOCK() or CAPSLOCK() in conjunction with another logical expression.

For example, the following code will correctly display the WAIT window message:
      * ensure the NUMLOCK key is on
      STORE .T. to istrue
      IF NUMLOCK()
         IF istrue
            WAIT WINDOW 'they are both true'
         ENDIF
      ENDIF
				

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

To reproduce this behavior, use the following code example:
      * ensure the NUMLOCK key is on
      STORE .T. to istrue
      IF NUMLOCK() AND istrue
         WAIT WINDOW 'they are both true'
      ENDIF
				
Note that the WAIT window message does not appear as it should in this example.

Additional query words: FoxDos 2.50 2.50a 2.50b true logic logical both buglist2.00 buglist2.50 buglist2.50a buglist2.50b buglist2.60

Keywords: kbbug kbprogramming kbpending KB113174