RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
System.UniqueString Function

Ensures that a given string has a reference count of one.

Pascal
procedure UniqueString(var str: AnsiString); overload;
procedure UniqueString(var str: WideString); overload;
C++
UniqueString(AnsiString str);
UniqueString(BSTR str);

System

UniqueString forces the reference count on an AnsiString to one, copying the string in memory if necessary. For normal string handling, there is no need to call UniqueString. UniqueString is used only in cases where an application modifies the contents of a string after

Note: casting the string to a PChar or PWideChar in Delphi.
Note: using the c_str() method of AnsiString or the c_bstr() method of WideString in C++.
 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!