program Project26; {$APPTYPE CONSOLE} uses SysUtils; var a, b: array of string; begin SetLength(a,1); a[0] := IntToStr(Random(1)); // making sure I'm not assigning a constant string WriteLn('StringRefCount(a[0])=', StringRefCount(a[0])); // Displays "2" SetLength(b,1); Move(a[0], b[0], SizeOf(Pointer)); // "Move" the memory WriteLn('StringRefCount(a[0]) after Move =', StringRefCount(a[0])); // Displays "2" - wrong, because we now have +1 references to the same string SetLength(a,0); // Will actually free the string WriteLn('StringRefCount(b[0]) after SetLength(a,0) =', StringRefCount(b[0])); // Displays "1" - wrong, because that means the string ReadLn; end.