I have the following variable declarations:
arrChar_1: array[0..2] of Char;
arrChar_2: array[0..2] of Char;
str: string;
Then I made the assignment:
str := arrChar_1 + arrChar_2;
This assignment works normally on Delphi 6. But error occurs when I compile it on Delphi 10.2:
[dcc32 Error] MigrateConcatenateCharArray.dpr(26): E2008 Incompatible types
I'm solving this problem in the following way:
str := Copy(first_arrChar, 0, StrLen(first_arrChar));
str := str + Copy(second_arrChar, 0, StrLen(second_arrChar));
Is there any other good solution to this problem? (1)
In Delphi 6:
String = AnsiString
Char = AnsiChar
In Delphi 10.2:
String = UnicodeString
Char = WideChar
Can tell me what caused the incompatibility issue to occur? (2)
I'm understanding that widechar is a multi-byte character type. Unicode is the way that characters are encoded. But I'm confused about them.