The following two declarations are not the same, even though they appear to be. They're not assignment compatible, even though they're both based on array of string
.
type
TStringArrayOne = array of string;
TStringArrayTwo = array of string;
var
AVar1, AVar2: TStringArrayOne;
AVar3, AVar4: TStringArrayTwo;
begin
AVar1 := TStringArrayOne.Create('a', 'b', 'c'); // Compiles
AVar2 := TStringArrayTwo.Create('a', 'b', 'c'); // Won't compile
AVar3 := TStringArrayTwo.Create('a', 'b', 'c'); // Compiles
AVar4 := TStringArrayOne.Create('a', 'b', 'c'); // Won't compile
end;
So TBytes
and TIdBytes
are not the same type, even if they're both defined as being array of Byte
.
With regard to your question 2: It's a common problem with some third-party code. Indy in particular is known for making changes that breaks backward compatibility because they decide to reorganize or rewrite things between versions. Indy 10 was a major change from Indy 9, IIRC, and pretty much required a rewrite of most code that used it if you updated to the later version of Indy (even without updating Delphi at the same time). If you don't want to deal with those changes, you might want to look at using a more stable IP communications package. There are several available that are also free, open source packages.