> TurboPascal and Delphi differ in the way they do strnew. > Delphi allocates additional two bytes preceding the first > character to store the length of the string. > > The turbo pascal docs say: > The allocated space is StrLen(Str) + 1 bytes long. > > The delphi docs say: > A 16-bit number giving the total amount of memory allocated is stored > in the two bytes preceding the first character; it is equal to Size+2.
Note that Delphi stores the size of every allocation at $-4. (and maybe $-2 in 16-bit Delphi). However this is done by the heapmanager, not strnew. If this is meant, it can still be perfectly compatible. _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel