Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
Delphi 10.2 Tokyo Professional
|
AW: Bits an String anfügen
17. Aug 2011, 10:04
Hallo,
Ich hätte da was für dich. Weiß jetzt nicht ob das für dich eleganter ist:
Delphi-Quellcode:
procedure AddInt64ToString(var S: String; Val: Int64); inline;
var OldLen: Integer;
begin
OldLen := Length(S);
SetLength(S,OldLen+SizeOf(Int64) div SizeOf(Char));
Move(Val,S[OldLen+1],SizeOf(Int64));
end;
procedure TForm1.FormCreate(Sender: TObject);
var n: Int64;
Str: String;
begin
n := $0074006C00650057;
Str := 'Hallo ';
AddInt64ToString(Str,n);
Caption := Str;
end;
Michael "Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
Geändert von Neutral General (17. Aug 2011 um 12:57 Uhr)
|