Hello, All!
I tried posting this behavior to the VFP bug report page, but I get a Page
Unavailable error. I think this is a bug. If you can confirm this, perhaps
Lee or one of the MVP's who hang out here can forward it to the right
people.
I am using the TEXTMERGE functions to merge memvars with preformatted RTF
text that is stored in a table. If the RTF contains one or more spaces
followed by a CHR(13), then the spaces are removed. To demonstrate this
behavior, try this code. Note, I did not include any variables to merge with
the text.
<vfp_code>
lcTest = "Here are 10 spaces:" + SPACE(10) + CHR(13) + "This is the second
line."
set textmerge to test.txt
set textmerge on
\\<<lcTest>>
set textmerge to
c = filetostr("test.txt")
?SPACE(10)$c && .F.
</vfp_code>
I was able to fix this issue by replacing spaces prior to using the
textmerge features, but I find it a bit quick and dirty:
<vfp_code>
lcTest = "Here are 10 spaces:" + SPACE(10) + CHR(13) + "This is the second
line."
lcTest = STRTRAN(lcTest, " ", "!@#$QUICKANDDIRTYFIX")
set textmerge to test.txt
set textmerge on
\\<<lcTest>>
set textmerge to
* now lets hope the replacement string does not exist in the preformatted
RTF....
* otherwise use a function like SYS(2015).
c = STRTRAN(filetostr("test.txt"), "!@#$QUICKANDDIRTYFIX", " ")
?SPACE(10)$c && .T.
</vfp_code>
So what do you think: is this behavior by design?
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8