System.SetAnsiString

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

procedure SetAnsiString(Dest: _PAnsiStr; Source: PWideChar; Length: Integer; CodePage: Word);

C++

extern DELPHI_PACKAGE void __fastcall SetAnsiString(PAnsiString Dest, WideChar * Source, int Length, Word CodePage);

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 Object Pascal, 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.

See Also