Peter N Lewis wrote:
- Perhaps most importantly, the New solution took a few minutes to
write and run reliably. The Ptr based one took much longer to write and required several corrections to the code before it past the tests. Clearly it is far more complicated, convoluted, and error prone.
Obviously. ;-)
I fear I am still stuck in the old days of caring too much about memory and cycles. Mind you, even with a machine running several billion instructions per second, it is amazing how often I am waiting for it to finish some task, so perhaps these are still issues - just issues that should be carefully chosen...
Since I got my current machine, I'm often "shocked" how many simultaneous tasks I have to start to keep it busy (or lose overview myself ;-) ...
Just two comments to make your code more portable:
siz := (SizeOf(StringN)+3) and not 3; // Round up to four bytes
Better `SizeOf (Integer) - 1)' instead of 3.
Inc(UInt32(storagep),siz);
Better PtrCard instead of UInt32 (a pointer is not always 32 bit).
Frank