In converting our old app from WPT5 with D2007 over to WPT8 with Delphi Rio 10.3.1, I'd like to resolve this warning during an assembly of multiple WPRichText data from a database into a single WPRIchText "report". Ignoring the warnings produces a good overall result, but just don't like warnings... too much noise in the build messages
W1057 Implicit string cast from 'AnsiString' to 'string'
when using statements like:
WPRichText1.SelectionAsString := WPRichText3.AsANSIString('WPTOOLS');
What is your best recommendation to avoid this warning? Do an explicit cast? I did try changing it to the following but it might not give me the same overall result (keep reading):
WPRichText_ASTopic.SelectionAsString := WPRichText3.AsString;
I also get the inverse warning of:
W1058 Implicit string cast with potential data loss from 'string' to 'AnsiString' when doing a mailmerge:
Contents.StringValue := WPRichText4.AsString;
and changing it to the following might not produce the same overall result (keep reading):
Contents.StringValue := WPRichText4.AsAnsiString;
gain, ignoring the warnings produces a good "report", but have not investigated what goes wrong doing the alternate assignments as mentioned above, it's just the end "report" is not built correctly. It might be one or perhaps both of the alternate assignments causing the bad result, have not yet narrowed it down.
So to save time I thought I'd just post to you and the community and ask for the best recommendations to avoid these warnings.
Thanks,
Eric