Page 1 of 1

Problem with memo text printout

Posted: Thu Feb 13, 2020 7:09 pm
by TimStone
If I write the line " Mitch & Mary went to dinner" in a memo field, on screen it stores it, and displays it, correctly.

If I send it to the printer ( or even Preview ), it will print as "Mitch _ Mary went to dinner"

This occurs in the latest version of FWH, and is not present in the previous builds.

Re: Problem with memo text printout

Posted: Fri Feb 14, 2020 10:12 am
by Antonio Linares
Dear Tim,

Please try it this way:

"Mitch && Mary went to dinner"

Re: Problem with memo text printout

Posted: Fri Feb 14, 2020 4:49 pm
by TimStone
Antonio,

My clients don't write that way. It worked perfectly until the latest build of FWH. Anything in a memo field printed just like it was viewed on the screen.

My clients DO NOT LIKE CHANGE and so they are very upset with this right now. As programmers it might not be a big deal, but we write for our customers and their feelings matter.

Tim

Re: Problem with memo text printout

Posted: Fri Feb 14, 2020 5:15 pm
by James Bott
Tim,

A quick fix would be to pre-print modify the TXT file by doing a search for "&" and replace it with "&&" before sending it to the printer.

Of course a better fix would be for the FW code to be fixed. Do you have software to do a file1 verses file2 comparison? That way you can find the changed code and post it here. If you don't have software for that I can point you to one.

James

Re: Problem with memo text printout

Posted: Sat Feb 15, 2020 12:51 pm
by nageswaragunupudi
Thanks for pointing out. The problem is in the method SayText().
While methods Say(), cmSay() print the & character as expected, the method SayText() converts & as underscore of the next character (default behaviour of DrawTextEx()). This is bug in printer.prg and needs to be fixed.

But the problem is not new to the latest build. This behavior has been there in all builds from FWH1605 onwards till FWH1912. It might not have been noticed earlier but noticed now.

Image

Fix for this will be available in the next release.

Now this fix may be applied to the printer.prg of any existing versions in this way:

Please locate these lines (990 to 994 in fwh1912) in method SayText() of printer.prg:

Code: Select all

   if lByRef
      nRet  := FW_SayText( ::hDCOut, @cText, aRect, cAlign, oFont, nClrText, nClrBack )
   else
      nRet  := FW_SayText( ::hDCOut,  cText, aRect, cAlign, oFont, nClrText, nClrBack )
   endif
 
Please modify these lines by adding 2 more parameters to FW_SayText() like this:

Code: Select all

   if lByRef
      nRet  := FW_SayText( ::hDCOut, @cText, aRect, cAlign, oFont, nClrText, nClrBack, nil, 0x800 )
   else
      nRet  := FW_SayText( ::hDCOut,  cText, aRect, cAlign, oFont, nClrText, nClrBack, nil, 0x800 )
   endif
 

Re: Problem with memo text printout

Posted: Tue Feb 18, 2020 4:31 pm
by TimStone
Thank you. I'll do the patch this morning.