FIX: Error Assigning Memo Field To _CLIPTEXT Variable (297830)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 3.0
  • Microsoft Visual FoxPro for Windows 3.0b
  • 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 Q297830

SYMPTOMS

If you assign the value of a memo field directly to the _CLIPTEXT variable, Visual FoxPro may produce the following error:
Data type mismatch.

RESOLUTION

Use the ALLTRIM() function to convert the memo field into a string before assigning it to _CLIPTEXT.

STATUS

This problem was corrected in Microsoft Visual FoxPro version 7.0 for Windows.

MORE INFORMATION

Information stored in the _CLIPTEXT variable is available to be pasted as if it had been placed on the Clipboard using Cut or Copy operations.

In Visual FoxPro 6.0 and earlier, the following code produces the error:
*!* Q297830 FIX: Assigning Memo Field To _CLIPTEXT Variable Causes Error
CREATE CURSOR test (field1 M)
INSERT INTO test ;
   VALUES ("Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn.")

_CLIPTEXT = test.field1           && This line will produce an error.

_CLIPTEXT = ALLTRIM(test.field1)  && This line will not.
				

Modification Type:MajorLast Reviewed:5/10/2003
Keywords:kbBug kbCodeSnippet kbfix kbvfp700fix kbXBase KB297830