FIX: _VFP.Eval() Only Accepts Strings of 255 Characters or Less (221688)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0

This article was previously published under Q221688

SYMPTOMS

The Eval() method of the _VFP system variable cannot accept a string longer than 255 characters.
In Visual FoxPro 6.0, the following error appears:
OLE exception code 0 from Visual FoxPro for Windows:10 :Syntax error...
In Visual FoxPro 5.0x, this error appears:
OLE exception code 0 from Visual FoxPro for Windows: Syntax error...


This problem normally occurs when a COM client is calling the EVAL() method on the Visual FoxPro server.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed

MORE INFORMATION

Steps to Reproduce Behavior

In the Command window, type the following line of code:
_vfp.EVAL("MESSAGEBOX('" + REPLICATE("a",242) + "')")
				

The error mentioned in the Symptoms section appears.

NOTE: The MessageBox() function is 12 characters, two more for the quotes and then replicating the letter "a" 242 times makes 256 characters within the _vfp.EVAL() function.

Modification Type:MajorLast Reviewed:10/16/2002
Keywords:kbBug kbOOP kbVS600sp3fix kbXBase KB221688