FIX: Missing Closing Parenthesis Acts Like a Comment

Last reviewed: October 29, 1997
Article ID: Q140293
3.00 WINDOWS kbprg kbbuglist kbfixlist

The information in this article applies to:

  • Microsoft Visual FoxPro for Windows, version 3.0

SYMPTOMS

When you use the parenthesis symbol to enclose conditions to be evaluated and leave off the leading parenthesis, the closing parenthesis acts like a comment marker as if it were a double ampersand (&&). Any code that follows the closing parenthesis is ignored when the program is executed.

Visual FoxPro should give an error message when the opening parenthesis is missing, but in this case it does not.

RESOLUTION

Make sure that the closing parenthesis has a matching opening parenthesis.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual FoxPro 5.0 for Windows.

MORE INFORMATION

Steps to Reproduce Problem

Place the following code in a .prg file:

   a = .T.
   b = .T.
   c = .F.
   IF a AND b) AND c
      WAIT WINDOW "This expression must be true."
   ENDIF

The IF statement should not evaluate to true because the variable "c" is false. The wait window box shows up because the closing parenthesis does not allow FoxPro to see the rest of the statement. If the closing parenthesis is taken out or if a opening parenthesis is added, then the wait window box will not appear.


KBCategory: kbprg kbbuglist kbfixlist
KBSubcategory: FxprgGeneral VFoxWin buglist3.00 fixlist5.00
Additional reference words: 3.00
Keywords : buglist3.00 fixlist5.00 FxprgGeneral vfoxwin kbbuglist kbfixlist kbprg
Version : 3.00
Platform : 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: October 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.