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 72 73 74 75 76 77 78 79 80 81 82 83
| unit syncro_time;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls
type
TForm1 = class(TForm)
OpenDialog1: TOpenDialog;
Button1: TButton;
procedure Button1Click(Sender: TObject); // table pointer
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
n: integer ;
synchrotime, nosynchrotime : textfile ;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
const
column = 3 ;
line = 50000 ;
type
Table = array [0..line,0..column] of real ;
var
n : integer ;
T : table ;
tmps1,tab,column2,column3 : string;
i,j,postab,long : integer ;
begin
if opendialog1.execute then
Assignfile (nosynchrotime,'C:\Documents and Settings\ATOFI005\My Documents\Delphi\nosynchrotime.txt');
reset(nosynchrotime);
n := 0 ;
repeat;
inc(n);
readln(nosynchrotime);
until eof(nosynchrotime);
Assignfile (synchrotime,'C:\Documents and Settings\ATOFI005\My Documents\Delphi\synchrotime.txt');
rewrite (synchrotime);
readln(nosynchrotime,tmps1);
writeln ( synchrotime, 'system time',tmps1) ;
for i := 1 to n do begin
j:=2 ;
readln(nosynchrotime,tmps1);
tab := '#9' ;
postab := pos(tab,tmps1);
column2 := copy (tmps1,1,postab) ;
T[i,j]:= strtofloat(column2) ;
long := length(tmps1) ;
column3 := copy(tmps1,postab,long);
T[i,j+1]:= strtofloat(column3) ;
writeln (synchrotime, ' ',#9, T[i,j],#9,T[i,j+1]) ;
end;
closefile(nosynchrotime);
closefile(synchrotime);
end;
end. |
Partager