Re: SetString
- From: erewhon@xxxxxxxxxx (J French)
- Date: Wed, 28 Feb 2007 07:49:23 GMT
On Wed, 28 Feb 2007 05:29:24 +0100, Hans-Peter Diettrich
<DrDiettrich1@xxxxxxx> wrote:
Is it really possible, that D7 offers no SetWideString procedure?
Must I really copy WideChar by WideChar, from an PWideChar into an
WideString?
D4 does automatic conversion it creates a new WideString up to the
position of the first #0#0
Var
pWC :PWideChar;
WS1, WS2 :WideString;
S :String;
begin
// Get some data in memory
WS1 := 'Test Data'#0' More';
// Point a PWideChar at it
pWC := Addr( WS1[1] );
// Automatic conversion to a new WideString
// It will only get data up to #0#0
WS2 := pWC;
// Automatic conversion to Ansi String
S := WS2;
//
ShowMessage( S + ' ' + IntToStr(Length(S)) );
end;
.
- Follow-Ups:
- Re: SetString
- From: Hans-Peter Diettrich
- Re: SetString
- References:
- SetString
- From: Hans-Peter Diettrich
- SetString
- Prev by Date: Re: SetString
- Next by Date: Re: for loop (c-lang)
- Previous by thread: Re: SetString
- Next by thread: Re: SetString
- Index(es):
Relevant Pages
|