PRB: WordBasic's CHR$ Function Produces Error in Visual FoxPro (156939)
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 6.0
This article was previously published under Q156939 SYMPTOMS
Visual FoxPro produces one of the following three errors when using the
CHR$(11) function to place a newline character in a Microsoft Word 7.0a for
Windows 95 document:
OLE IDispatch exception code 5004 from Microsoft Word. Too
many or too few arguments.
OLE error code 0x80002006 Unknown name.
Syntax Error.
The error varies depending upon the version of Visual FoxPro being run.
However, these commands function properly in Visual Basic 4.0.
CAUSE
The dollar sign ($) character is an operator in Visual FoxPro. Therefore,
FoxPro expects the dollar sign character to carry out Xbase functionality
and not a WordBasic function.
WORKAROUND
Use FoxPro's CHR() function to insert the value into WordBasic. For
example, replace one of the following lines:
X.Insert(X.CHR$(11))
X.Insert(X.Object.CHR$(11))
with the following line:
X.Insert(CHR(11))
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 12/3/2003 |
---|
Keywords: | KB156939 |
---|
|