Delphi Seattle (S10). Win32 project.
Yesterday I got wrong result in my old routine. I found this line:
sPre := Copy(aSQLText, p - 1, 1);
aSQLText was 'CREATE', and p = 1.
The sPre got "C" result.
Hmmm... Then I wrote to watch window:
Copy('ABC', 0, 1)
and the result was "A"...
Ouch... What???
The copy handles the overflow in the end well. But not at the beginning? Or what?
I hope that I haven't got any codes which points to before the string.
Do you also got this result in your Delphi? Why?
As I know the strings internally stored as 4 byte length + string; and they based in 1 (not 0 as any arrays). Is this a bug?