Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C0000005 with TEXTMERGE()
Message
From
12/06/2002 11:43:46
 
 
To
12/06/2002 06:03:16
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00666832
Message ID:
00667446
Views:
21
What you may want to do is create a function like this:
function TextmergeX(lcString)
return CHRTRAN(TEXTMERGE(lcString+CHR(0)),CHR(0),"")
Then do a search adn replace in all your source code

Glenn

>Hi Christof,
>
>thank you for this suggestion. I did not start changing my textmerges yet, but I had something like that in mind to test.
>
>This all look like painfull work (I have hundreds of textmerges in my projects).
>
>Agnes
>
>>Hi Agnes,
>>
>>>Is there a know problem with TEXTMERGE()?
>>
>>Yes. Under some situations, VFP doesn't add a terminating CHR(0) to the string. If additionally, the string is stored at the end of an allocated memory block, a function in the MSVCRT runtime (strstr) accesses invalid memory. This attempt results in an exception raised by the Windows memory management. To fix this issue, you need to add CHR(0), as Tom mentioned, but also remove it afterwards:
>>
>>CHRTRAN(TEXTMERGE(lcString+CHR(0)),CHR(0),"")
>>
>>
>>Christof
Previous
Reply
Map
View

Click here to load this message in the networking platform