Einzelnen Beitrag anzeigen

Benutzerbild von Uwe Raabe
Uwe Raabe

Registriert seit: 20. Jan 2006
Ort: Lübbecke
11.009 Beiträge
 
Delphi 12 Athens
 
#2

AW: String in Array of Byte umwandeln [TKey]

  Alt 2. Mär 2018, 22:53
Delphi-Quellcode:
var
  arr: TArray<string>;
  S: string;
  Key: TKey;
  I: Integer;
begin
  S := '$3E,$C9,$18,$78,$7D,$AC,$AF,$D3,$64,$E0,$BC,$0A,$43,$68,$2C,$F2';
  arr := S.Split([',']);
  Assert(Length(arr) = Length(Key), 'Fehler im Keystring');
  for I := 0 to Length(Key) - 1 do begin
    Key[I] := StrToInt(arr[I]);
  end;
end;
Uwe Raabe
Certified Delphi Master Developer
Embarcadero MVP
Blog: The Art of Delphi Programming
  Mit Zitat antworten Zitat