function HexToBuffer(const Hex : string; var Buf; BufSize : Cardinal) : Boolean; var i, C : Integer; Str : string; Count : Integer; begin Result := False; Str := ''; for i := 1 to Length(Hex) do if Upcase(Hex[i]) in ['0'..'9', 'A'..'F'] then Str := Str + Hex[i];
for i := 0 to Count - 1 do begin Val('$' + Copy(Str, (i shl 1) + 1, 2), TByteArray(Buf)[i], C); {!!.01} if (C <> 0) then Exit; end; Result := True; end;