Hi Agnes,
>This all look like painfull work (I have hundreds of textmerges in my projects).
In this case you could consider not to modify the original source, but create a new TEXTMERGEFIXED.PRG file that calls TEXTMERGE and handles CHR(0). In your main include file add the following line
#DEFINE TEXTMERGE TEXTMERGEFIXED
When you rebuild the project VFP replaces all occurrences of TEXTMERGE with the call to your own function. Since Microsoft is aware of this issue we should expect this problem to be fixed in a future version. Then you can remove the #DEFINE line and your program uses the built-in function without any further changes.
There's one problem, however. Since TEXTMERGE() is now called in a program, references to THIS and THISFORM in textmerge expressions do not work anymore. If that's an issue, you can add a TextMerge method to all your base classes and use the #DEFINE to call THIS.TextMerge().
When you changed the include file, you have to recompile all .PRG files manually with COMPILE *.PRG. VFP won't recognize that the .prg changed, even when you check the "Build all" option. The fixed version of TEXTMERGE should either not include the main include file or use TEXTM() to call the native function. Otherwise, the call recurses until no DO levels remain left.
Christof
--
Christof