1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
function Right(st : String;i : integer) : String;
begin
Result := Copy(st,length(st)-i,i);
end;
var
FES : String[16];
FES_TIME : String[4];
Datum : TDateTime;
t : Integer;
c : Integer;
szHelp : String;
szHelp2 : String;
v : Variant;
l : Longint;
szFilename : String;
Stream : TFileStream;
begin
szFilename := ExtractFilepath(Application.ExeName) + '\Jugl.db';
Stream := TFileStream.Create(szFilename,fmOpenRead);
While Not(Stream.Size < Stream.Position) do
begin
Stream.Read(FES,length(FES));
If (Stream.Size < Stream.Position) Then
Exit;
Stream.Read(FES_TIME,length(FES_TIME));
szHelp := '';
For t := 1 To 4 do
szHelp := szHelp + Right('00' + Hex(ord(Copy(FES_TIME,t,1))),2)
l := '$'+ szHelp
Datum := DateAdd('s',l,EncodeDate(1970,01,01))
szHelp := '';
For t = 1 To 16 do
begin
c := ord(copy(FES, t, 1))
szHelp := szHelp + Right('00'+Hex(c), 2)
end;
List1.AddItem(FormatDateTime('hh:mm:ss dd.mm.yyyy',Datum) + ' -> ' + szHelp
end;
Stream.Free;
end;
procedure TForm1.Button1Click(Sender: TObject);
Var
szFilename : String;
t : Integer;
szHelp : String;
f : Integer;
Data : array of String;
begin
szFilename := ExtractFilepath(Application.ExeName) + '\v_fes.txt';
List1.Clear
// szHelp := Space(FileLen(szFilename))
Stream := TFileStream.Create(szFilename,fmOpenRead);
While Not(Stream.Size < Stream.Position) do
begin
Stream.Read(szHelp,Stream.Size);
end;
Stream.Free
Data := Split(szHelp, vbCrLf)
For t := 0 To high(Data) do
begin
If Trim(Data[t]) <> '' Then
List1.AddItem(Trim(Data[t]))
end;
end; |
Partager