Strings in Elements vs Delphi Code

This are a few code lines to reproduce the problem - I compiled with .NET

var astr : AnsiString;
var bstr : String;
astr := astr + bstr + #32;
astr := astr + bstr + β€˜test’;

Cool!
fixed today.

Edit: also implicits for assigning a AnsiString -> DelphiString and DelphiString -> AnsiStrings added today.

Thanks!

Also, =, >=, <=, <>, CompareText and CompareStr works with AnsiString, DelphiString parameters without conversion.

Regards

Many thanks - this will make the move easier a lot.

You put a lot of enhancements - looks great. Only the β€œ:” in PreserveChars: Boolean := true did not make it into the version on Git.

1 Like

Sorry, which change? Is not compiling for you?

Not a problem, it is probably already fixed - but at the time I downloaded from GIT there was this code in the AnsiString.pas:

AnsiString = public record
private
…
constructor(Value: array of Char; PreserveChars: Boolean = true);

With the β€œ:” missing .

Julian

ok! yes, was fixed.

If you have more suggestions about adding more classes / functions go ahead please, comments are always welcome!

bugs://E20447 was closed as fixed.