* use sysutils instead of dos

git-svn-id: trunk@7342 -
This commit is contained in:
peter 2007-05-15 07:18:55 +00:00
parent aa72495049
commit bf7275576c

View File

@ -18,20 +18,21 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
****************************************************************************} ****************************************************************************}
{$ifdef TP} program ppudump;
{$N+,E+}
{$endif} {$mode objfpc}
program pppdump; {$H+}
uses uses
dos, SysUtils,
ppu, ppu,
globals, globals,
tokens; tokens;
const const
Version = 'Version 2.1.1'; Version = 'Version 2.2.0';
Title = 'PPU-Analyser'; Title = 'PPU-Analyser';
Copyright = 'Copyright (c) 1998-2006 by the Free Pascal Development Team'; Copyright = 'Copyright (c) 1998-2007 by the Free Pascal Development Team';
{ verbosity } { verbosity }
v_none = $0; v_none = $0;
@ -293,7 +294,7 @@ end;
const const
HexTbl : array[0..15] of char='0123456789ABCDEF'; HexTbl : array[0..15] of char='0123456789ABCDEF';
function HexB(b:byte):string; function HexB(b:byte):shortstring;
begin begin
HexB[0]:=#2; HexB[0]:=#2;
HexB[1]:=HexTbl[b shr 4]; HexB[1]:=HexTbl[b shr 4];
@ -301,7 +302,7 @@ begin
end; end;
function hexstr(val : cardinal;cnt : byte) : string; function hexstr(val : cardinal;cnt : byte) : shortstring;
const const
HexTbl : array[0..15] of char='0123456789ABCDEF'; HexTbl : array[0..15] of char='0123456789ABCDEF';
var var
@ -336,15 +337,20 @@ end;
convert dos datetime t to a string YY/MM/DD HH:MM:SS convert dos datetime t to a string YY/MM/DD HH:MM:SS
} }
var var
DT : DateTime; DT : TDateTime;
hsec : word;
Year,Month,Day: Word;
hour,min,sec : word;
begin begin
if t=-1 then if t=-1 then
begin begin
FileTimeString:='Not Found'; Result := 'Not Found';
exit; exit;
end; end;
unpacktime(t,DT); DT := FileDateToDateTime(t);
filetimestring:=L0(dt.Year)+'/'+L0(dt.Month)+'/'+L0(dt.Day)+' '+L0(dt.Hour)+':'+L0(dt.min)+':'+L0(dt.sec); DecodeTime(DT,hour,min,sec,hsec);
DecodeDate(DT,year,month,day);
Result := L0(Year)+'/'+L0(Month)+'/'+L0(Day)+' '+L0(Hour)+':'+L0(min)+':'+L0(sec);
end; end;