You've already forked lazarus-ccr
LazStats: Remove two goto instructions in the BreakDown method of CrossTabUnit.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7710 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -44,21 +44,14 @@ type
|
|||||||
procedure SelListDblClick(Sender: TObject);
|
procedure SelListDblClick(Sender: TObject);
|
||||||
procedure VarListDblClick(Sender: TObject);
|
procedure VarListDblClick(Sender: TObject);
|
||||||
procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean);
|
procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean);
|
||||||
|
|
||||||
private
|
private
|
||||||
{ private declarations }
|
|
||||||
FReportFrame: TReportFrame;
|
FReportFrame: TReportFrame;
|
||||||
FAutosized: Boolean;
|
FAutosized: Boolean;
|
||||||
|
|
||||||
// procedure Initialize;
|
|
||||||
// procedure GetLevels(AReport: TStrings);
|
|
||||||
// function IndexPosition(x: IntDyneVec): integer;
|
|
||||||
// Procedure Tabulate;
|
|
||||||
// procedure BreakDown(AReport: TStrings);
|
|
||||||
procedure Prepare(out AVarList, AColNoSelected: IntDyneVec);
|
procedure Prepare(out AVarList, AColNoSelected: IntDyneVec);
|
||||||
procedure UpdateBtnStates;
|
procedure UpdateBtnStates;
|
||||||
|
|
||||||
public
|
public
|
||||||
{ public declarations }
|
|
||||||
procedure Reset; override;
|
procedure Reset; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -110,7 +103,7 @@ type
|
|||||||
|
|
||||||
procedure TCrossTabCalculator.BreakDown;
|
procedure TCrossTabCalculator.BreakDown;
|
||||||
label
|
label
|
||||||
1,2,3,4, printgrid;
|
2,3,4;
|
||||||
var
|
var
|
||||||
i, j, row, col, bigmax: integer;
|
i, j, row, col, bigmax: integer;
|
||||||
ptr1, ptr2: Integer;
|
ptr1, ptr2: Integer;
|
||||||
@ -148,57 +141,57 @@ begin
|
|||||||
col := 1;
|
col := 1;
|
||||||
row := 1;
|
row := 1;
|
||||||
|
|
||||||
1:
|
while true do
|
||||||
index := IndexPosition(subscript);
|
begin
|
||||||
outline := 'For cell levels: ';
|
index := IndexPosition(subscript);
|
||||||
for i := 1 to no_in_list do
|
outline := 'For cell levels: ';
|
||||||
begin
|
for i := 1 to no_in_list do
|
||||||
j := FVarList[i-1];
|
begin
|
||||||
value := Format('%s:%3d ',[FDataGrid.Cells[j,0], min_value[i-1] + subscript[i-1] - 1]);
|
j := FVarList[i-1];
|
||||||
outline := outline + value;
|
value := Format('%s:%3d ',[FDataGrid.Cells[j,0], min_value[i-1] + subscript[i-1] - 1]);
|
||||||
end;
|
outline := outline + value;
|
||||||
sum := sum + freq[index];
|
end;
|
||||||
outgrid[row-1,col-1] := freq[index];
|
sum := sum + freq[index];
|
||||||
outline := outline + Format(' Frequency: %3d', [freq[index]]);
|
outgrid[row-1,col-1] := freq[index];
|
||||||
FReport.Add(outline);
|
outline := outline + Format(' Frequency: %3d', [freq[index]]);
|
||||||
|
FReport.Add(outline);
|
||||||
|
|
||||||
subscript[ptr2-1] := subscript[ptr2-1] + 1;
|
subscript[ptr2-1] := subscript[ptr2-1] + 1;
|
||||||
col := col + 1;
|
col := col + 1;
|
||||||
if subscript[ptr2-1] <= levels[ptr2-1] then
|
if subscript[ptr2-1] <= levels[ptr2-1] then
|
||||||
goto 1;
|
continue;
|
||||||
|
|
||||||
FReport.Add('Sum across levels: %3d', [sum]);
|
FReport.Add('Sum across levels: %3d', [sum]);
|
||||||
FReport.Add('');
|
FReport.Add('');
|
||||||
|
|
||||||
grandsum := grandsum + sum;
|
grandsum := grandsum + sum;
|
||||||
sum := 0;
|
sum := 0;
|
||||||
row := row + 1;
|
row := row + 1;
|
||||||
|
|
||||||
2:
|
2:
|
||||||
if ptr1 < 1 then
|
if ptr1 < 1 then
|
||||||
goto printgrid;
|
break;
|
||||||
|
|
||||||
subscript[ptr1-1] := subscript[ptr1-1] + 1;
|
subscript[ptr1-1] := subscript[ptr1-1] + 1;
|
||||||
if subscript[ptr1-1] <= levels[ptr1-1] then
|
if subscript[ptr1-1] <= levels[ptr1-1] then
|
||||||
goto 4;
|
goto 4;
|
||||||
|
|
||||||
3:
|
3:
|
||||||
ptr1 := ptr1 - 1;
|
ptr1 := ptr1 - 1;
|
||||||
if ptr1 < 1 then
|
if ptr1 < 1 then
|
||||||
goto printgrid;
|
break;
|
||||||
if subscript[ptr1-1] >= levels[ptr1-1] then
|
if subscript[ptr1-1] >= levels[ptr1-1] then
|
||||||
goto 3;
|
goto 3;
|
||||||
subscript[ptr1-1] := subscript[ptr1-1] + 1;
|
subscript[ptr1-1] := subscript[ptr1-1] + 1;
|
||||||
|
|
||||||
4:
|
4:
|
||||||
for i := ptr1 + 1 to no_in_list do
|
for i := ptr1 + 1 to no_in_list do
|
||||||
subscript[i-1] := 1;
|
subscript[i-1] := 1;
|
||||||
ptr1 := no_in_list - 1;
|
ptr1 := no_in_list - 1;
|
||||||
col := 1;
|
col := 1;
|
||||||
|
|
||||||
goto 1;
|
end;
|
||||||
|
|
||||||
printgrid:
|
|
||||||
title := 'CELL FREQUENCIES BY LEVELS';
|
title := 'CELL FREQUENCIES BY LEVELS';
|
||||||
for i := 1 to row - 1 do
|
for i := 1 to row - 1 do
|
||||||
begin
|
begin
|
||||||
|
Reference in New Issue
Block a user