Link to home
Create AccountLog in
Avatar of Labib Nassim
Labib Nassim

asked on

Typecasting TBytes to Integer in Delphi XE8

In Delphi 7, I used to be able to do following:

Type
  TA4: array[1..4] of char;

var
  a4: TA4;
  n1: Integer;

  a4[1] := #1;
  a4[2] := #2;
  a4[3] := #1;
  a4[4] := #2;

  n1 := Integer(a4);

Now - with XE8 - it no longer works and it produces a message "E2089 Invalid Typecast"

Is there another way of doing it? The data is now coming from Bytes1: TBytes

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Sinisa Vuk
Sinisa Vuk
Flag of Croatia image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Labib Nassim
Labib Nassim

ASKER

Thank you. So obvious in retrospect. :)