Autor Beitrag
Flamefire
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1207
Erhaltene Danke: 31

Win 10
Delphi 2009 Pro, C++ (Visual Studio)
BeitragVerfasst: So 09.03.08 10:50 
Ich hab eine Datei, bestehend aus nem Hex-Dump (z.b. "00 1E 23 FF 00"...)
die will ich in ein Bytearray laden, welches ich dann aufteilen muss
nur ist die Datei 570KB groß und ne For schleife braucht ewig
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.Button1Click(Sender: TObject);
var sl:TStringlist;
    i:Integer;
begin
  sl:=TStringlist.Create;
  sl.LoadFromFile('data.txt');
  SetLength(bytearr,Trunc(Length(sl.Text)/2));
  For i:=0 to Length(bytearr)-1  do begin
    bytearr[i]:=StrToInt('$'+MidStr(sl.Text,i*3+1,2));
  end;
end;


(bytearr ist Array of Byte)

geht das i-wie schneller?