Saturday, 15 June 2013

chr equivalent for Unicode in Delphi 7 -



chr equivalent for Unicode in Delphi 7 -

i need initialize widestring in delphi 7 can't utilize chr function ansi

var ws : widestring; begin ws := chr($ffff) + chr($ffff) + chr($ffff); end;

what can use, ?

thanks

i'm not sure there's way wish. can convert word widechar simple cast:

widechar($ffff)

but cannot concatenate widechar. compiler error:

widechar($ffff) + widechar($ffff)

you utilize helper function job done:

function initialisewidestring(const chars: array of word): widestring; var i: integer; begin setlength(result, length(chars)); := 0 high(chars) result[i+1] := widechar(chars[i]); end;

then can phone call this:

ws := initialisewidestring([$0054, $0069, $006d, $0065, $0020, $0074, $006f, $0020, $0075, $0070, $0067, $0072, $0061, $0064, $0065]);

delphi delphi-7

No comments:

Post a Comment