troubleshooting Question

Typecasting TBytes to Integer in Delphi XE8

Avatar of Labib Nassim
Labib Nassim asked on
Delphi* xe8
2 Comments1 Solution678 ViewsLast Modified:
In Delphi 7, I used to be able to do following:

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

  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.
Sinisa Vuk
Software architect
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros