Re: copy one character from a string.



I'm only following advice in Delphi Help <g> ...

"procedure UniqueString(var S: string);

Description
Following a call to SetString, S is guaranteed to reference a unique
string; that is, a string with a reference count of one. For normal
string handling, there is no need to ever call UniqueString. Only in
cases where an application casts a string to a PChar and then modifies
the contents of the string must UniqueString be used."

....or is there something else subtle which UniqueString or SetLength
does ?

Alan Lloyd

.



Relevant Pages

  • Delphi4 string handling finally catches up with me.
    ... I actually log *every* memory allocation in a big ... These happen to contain a string: ... I now have a scheme to avoid this based on "UniqueString". ... a buffer. ...
    (comp.lang.pascal.delphi.misc)
  • Re: copy one character from a string.
    ... > Following a call to SetString, S is guaranteed to reference a unique ... > string; that is, a string with a reference count of one. ... there is no need to ever call UniqueString. ... > ...or is there something else subtle which UniqueString or SetLength ...
    (comp.lang.pascal.delphi.misc)
  • Re: how to obtain the pointer to the buffer of a string?
    ... The function calls UniqueString when casting to a PChar as strings are resource managed. ... one string can be used in many places and delphi will try to prevent you from corrupting the data by giving you an unique version of the string you can safely modify. ...
    (borland.public.delphi.language.basm)
  • Re: String --> Pointer --> LongInt
    ... A long string value lives on the heap; ... buffer and a terminating NUL character beyond it for compatibility ... value is modified or explicitly by UniqueString() or SetLength(). ...
    (alt.comp.lang.borland-delphi)
  • Re: Complex Specified Information - Pitman Formula
    ... Therefore a significant match between a reference and a test ... string is good evidence of non-random production. ... and there are no finite algorithms to compute their digits. ... probabilities of the different symbols the information source can produce. ...
    (talk.origins)