Re: copy one character from a string.



<alanglloyd@xxxxxxx> wrote in message
news:1132826429.569524.307220@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[...]
> S2:=S1; // S2 now points to S1, only one instance exists in memory.
> // The string has a refcount of 2.
> SetLength(S2, Length(S2)); // S2 is now copied into a newly allocated
> // string, both S1 and S2 having a refcount
> // of 1.

If I wanted a refcount of 1, I'd call UniqueString. Not because SetLength
doesn't guarantee the refcount (it does), but because I feel it shouldn't.

Groetjes,
Maarten Wiltink


.