System.SetAnsiString
Delphi
procedure SetAnsiString(Dest: _PAnsiStr; Source: _PAnsiChr; Length: Integer; CodePage: Word);
procedure SetAnsiString(Dest: _PAnsiStr; Source: PWideChar; Length: Integer; CodePage: Word);
C++
extern DELPHI_PACKAGE void __fastcall SetAnsiString(PAnsiString Dest, char * Source, int Length, Word CodePage)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | System.pas System.hpp |
System | System |
Description
Sets the contents and length of the given AnsiString.
Use SetAnsiString to copy the contents of a given PWideChar to an AnsiString variable. The Length parameter specifies the number of characters to copy and CodePage specifies the code page used when transforming the Unicode characters to ANSI characters.
Note: In Delphi, there is no need to call SetAnsiString; the compiler automatically inserts these calls on programmer's behalf whenever an assignment from a Unicode string to an AnsiString is encountered.