Microsoft KB Archive/189773

= FIX: Compile Fails in WITH/ENDWITH and IF Using Dot Operator =

Article ID: 189773

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a

-



This article was previously published under Q189773



SYMPTOMS
When you write a program or procedure containing an IF expression that evaluates a property or method reference using the "." (dot) operator within a WITH/ENDWITH construct and you attempt to run or compile the code, you might get one of the following errors:

Command contains unrecognized phrase/keyword.

Data type mismatch.



RESOLUTION
Include a full object reference in the IF line, rather than the "." operator reference that is normally used with the WITH/ENDWITH.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This has been corrected in Visual FoxPro 6.0.



Steps to Reproduce Behavior
  Copy the following code into a program (.PRG) file: PUBL ox     ox = CREATEOBJECT('form1') ox.Show

DEFI class form1 as form cProperty = "XXX" PROC init WITH This IF NOT 'XXX' $ .cProperty ENDIF ENDWITH ENDDEFINE  Compile or attempt to run the code.

RESULT: In Visual FoxPro 5.0x, the following error appears:

Command contains unrecognized phrase/keyword.

In Visual FoxPRo 3.0x, the following error appears:

Data type mismatch.

To make the code compile and run without error in each version, change: IF NOT 'XXX' $ .cProperty

-to-

IF NOT 'XXX' $ this.cProperty,

Additional query words: kbVFp300bbug kbVFp500abug kbVFp600fix

Keywords: kbbug kbfix KB189773

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.