L
liuchengr
Unregistered / Unconfirmed
GUEST, unregistred user!
to TENTODBV
这是我的代码,只是收到StringGrid的行限制。Data[n,7]是一个标志,0:未显示,1:已显示
const Max_Array = 2000000;
type
TForm1 = class(TForm)
StringGrid1: TStringGrid;
Panel1: TPanel;
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
procedure StringGrid1TopLeftChanged(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
Data: Array [ 0..Max_Array,0..7] of integer;
Procedure ShowAPage(Top: Integer);
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.StringGrid1TopLeftChanged(Sender: TObject);
var
Pos1: Integer;
begin
Pos1 := StringGrid1.TopRow;
Edit1.Text := intToStr(Pos1);
ShowAPage(Pos1);
end;
procedure TForm1.FormCreate(Sender: TObject);
var
i,j: Integer;
xx: Cardinal;
Begin
xx := GetTickCount;
For i:= 1 to Max_Array do
Begin
Data[i,0] := 1 * 7 - 7;
Data[i,1] := 1 * 7 + 1 - 7;
Data[i,2] := 1 * 7 + 2 - 7;
Data[i,3] := 1 * 7 + 3 - 7;
Data[i,4] := 1 * 7 + 4 - 7;
Data[i,5] := 1 * 7 + 5 - 7;
Data[i,6] := 1 * 7 + 6 - 7;
Data[i,7] := 0;
End;
StringGrid1.RowCount := Max_Array;
ShowAPage(1);
Edit2.Text := FloatToStr((GetTickCount - xx) /1000) + '秒';
end;
procedure TForm1.ShowAPage(Top: Integer);
var
i,j: Integer;
begin
For j := 0 to 14 do
Begin
IF Data[Top,7] = 0 THEN
Begin
For i := 0 to 6 do
StringGrid1.Cells[i + 1,Top] := IntToStr(Data[Top,i]);
Data[Top,7] := 1;
End;
Inc(Top);
IF Top > Max_Array THEN Break;
End;
end;
这是我的代码,只是收到StringGrid的行限制。Data[n,7]是一个标志,0:未显示,1:已显示
const Max_Array = 2000000;
type
TForm1 = class(TForm)
StringGrid1: TStringGrid;
Panel1: TPanel;
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
procedure StringGrid1TopLeftChanged(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
Data: Array [ 0..Max_Array,0..7] of integer;
Procedure ShowAPage(Top: Integer);
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.StringGrid1TopLeftChanged(Sender: TObject);
var
Pos1: Integer;
begin
Pos1 := StringGrid1.TopRow;
Edit1.Text := intToStr(Pos1);
ShowAPage(Pos1);
end;
procedure TForm1.FormCreate(Sender: TObject);
var
i,j: Integer;
xx: Cardinal;
Begin
xx := GetTickCount;
For i:= 1 to Max_Array do
Begin
Data[i,0] := 1 * 7 - 7;
Data[i,1] := 1 * 7 + 1 - 7;
Data[i,2] := 1 * 7 + 2 - 7;
Data[i,3] := 1 * 7 + 3 - 7;
Data[i,4] := 1 * 7 + 4 - 7;
Data[i,5] := 1 * 7 + 5 - 7;
Data[i,6] := 1 * 7 + 6 - 7;
Data[i,7] := 0;
End;
StringGrid1.RowCount := Max_Array;
ShowAPage(1);
Edit2.Text := FloatToStr((GetTickCount - xx) /1000) + '秒';
end;
procedure TForm1.ShowAPage(Top: Integer);
var
i,j: Integer;
begin
For j := 0 to 14 do
Begin
IF Data[Top,7] = 0 THEN
Begin
For i := 0 to 6 do
StringGrid1.Cells[i + 1,Top] := IntToStr(Data[Top,i]);
Data[Top,7] := 1;
End;
Inc(Top);
IF Top > Max_Array THEN Break;
End;
end;