Z
z_f123
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
OpenDialog1: TOpenDialog;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure getsigdata (strs:string) ;
end;
var
Form1: TForm1;
aaa:array[1..21] of boolean;
implementation
{$R *.dfm}
var sigdataarray:array[1..21] of string ;
procedure tform1.getsigdata (strs:string) ;
var i ,i1:integer;
strk,strk1,strk2:string;
doubdata:double;
begin
i1:=length(strs);
for i:=1 to i1 do
begin
strk:=copy(strs,i,1);
strk1:=strk1+strk;
if (strk=' ') then
begin
doubdata:=strtofloat(trim(strk1));
strk2:=formatfloat('0.00',doubdata);
edit1.Text :=strk2;
sigdataarray:= strk2;
doubdata:=0.00;
strk1:='';
strk:='';
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var fopen :textfile;
nopen:string;
DATASTR:STRING;
i:integer;
begin
if opendialog1.Execute then
nopen:=opendialog1.FileName;
assignfile(fopen,nopen); //
if fileexists(nopen) then
begin
RESET(FOPEN);
READLN(FOPEN,DATASTR);
getsigdata (DATASTR);
for i:=1 to 21 do // 问题出在这里:当单步运行时候 会发现I的值是从21减到
//1 的 ,而不是又1 递增到 21 这是为什么?
begin
aaa:=true;
end;
end;
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
OpenDialog1: TOpenDialog;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure getsigdata (strs:string) ;
end;
var
Form1: TForm1;
aaa:array[1..21] of boolean;
implementation
{$R *.dfm}
var sigdataarray:array[1..21] of string ;
procedure tform1.getsigdata (strs:string) ;
var i ,i1:integer;
strk,strk1,strk2:string;
doubdata:double;
begin
i1:=length(strs);
for i:=1 to i1 do
begin
strk:=copy(strs,i,1);
strk1:=strk1+strk;
if (strk=' ') then
begin
doubdata:=strtofloat(trim(strk1));
strk2:=formatfloat('0.00',doubdata);
edit1.Text :=strk2;
sigdataarray:= strk2;
doubdata:=0.00;
strk1:='';
strk:='';
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var fopen :textfile;
nopen:string;
DATASTR:STRING;
i:integer;
begin
if opendialog1.Execute then
nopen:=opendialog1.FileName;
assignfile(fopen,nopen); //
if fileexists(nopen) then
begin
RESET(FOPEN);
READLN(FOPEN,DATASTR);
getsigdata (DATASTR);
for i:=1 to 21 do // 问题出在这里:当单步运行时候 会发现I的值是从21减到
//1 的 ,而不是又1 递增到 21 这是为什么?
begin
aaa:=true;
end;
end;
end;
end.