Why Copy function behaves differently in 64-bit Delphi XE3?
Asked Answered
B

1

8

In Delphi XE3, the Copy function can be used for string type with or without the third parameter. For example,

s := '1234567890';
Writeln(Copy(s, 2));

The above prints 234567890 if compiled for 32-bit EXE. However when the same code compiles to 64-bit EXE, it will print nothing.

Why is this? I have to actually change all such code to e.g. Copy(s, 2, Length(s) - 1) when porting 32-bit app to 64-bit.

Baroness answered 22/4, 2013 at 8:27 Comment(1)
qc.embarcadero.com/wc/qcmain.aspx?d=113805Annulate
E
11

I could not reproduced the behaviour you report. When I compiled that code in a fully updated 64 bit XE3, the code produced the expected output.

I conclude that either:

  1. You have not fully updated your XE3 installation.
  2. Your code is using a different Copy function that is contained in your code.

Thanks to @bummi for pointing out the QC report that proves that item 1 is the explanation. Your solution is (obviously) to apply the updates.

Eastwardly answered 22/4, 2013 at 8:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.