David Emerson schrieb:
I *am* checking sizes before the move, which is why it surprised me that things
were going out of bounds -- the trouble is I forgot the array index [0]
Yes, that happens quite often. Unfortunately, Borland gave up the clear und
predictable context independend Pascal syntax when implementing dynamic data
structures. Dynamic arrays are actually *pointers* to the data while static
arrays are the data itself. But the pointers of dynamic arrays are dereferenced
automatically when used except for fundamental byte functions like move or
fillchar. It would have been better to dereference the pointer for these
functions too. I don't know why Borland did not do that. Now we have to live
with this mess only because of Delphi compatibility.
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal