Why does the copy function work differently in 64-bit Delphi XE3?

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

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

The above prints are 234567890, if compiled for a 32-bit EXE. However, when the same code compiles into a 64-bit EXE, it does not print anything.

Why is this? I have to actually modify all such code, for example. Copying (s, 2, Length (s) - 1) when porting a 32-bit application to 64-bit.

+8
copy delphi delphi-xe3
source share
1 answer

I could not reproduce the behavior you described. When I compiled this code in a fully updated 64-bit XE3, the code produced the expected result.

I conclude that either:

  • You have not completely updated your XE3 installation.
  • Your code uses another Copy function contained in your code.

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

+11
source share

All Articles