From 746509e94a2e50509b0660ca5aef924071b8208a Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Mon, 28 Sep 2020 21:18:41 +0000 Subject: [PATCH] LazStats: Remove remaining goto instructions from the crosstab BreakDown procedure git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7711 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../analysis/descriptive/crosstabunit.pas | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/applications/lazstats/source/forms/analysis/descriptive/crosstabunit.pas b/applications/lazstats/source/forms/analysis/descriptive/crosstabunit.pas index 16b1eeb3a..98ca02e56 100644 --- a/applications/lazstats/source/forms/analysis/descriptive/crosstabunit.pas +++ b/applications/lazstats/source/forms/analysis/descriptive/crosstabunit.pas @@ -102,8 +102,6 @@ type procedure TCrossTabCalculator.BreakDown; -label - 2,3,4; var i, j, row, col, bigmax: integer; ptr1, ptr2: Integer; @@ -168,23 +166,22 @@ begin sum := 0; row := row + 1; - 2: if ptr1 < 1 then break; subscript[ptr1-1] := subscript[ptr1-1] + 1; - if subscript[ptr1-1] <= levels[ptr1-1] then - goto 4; + if subscript[ptr1-1] > levels[ptr1-1] then + begin + repeat + ptr1 := ptr1 - 1; + if ptr1 < 1 then + break; + until subscript[ptr1-1] < levels[ptr1-1]; + if ptr1 < 1 then + break; + subscript[ptr1-1] := subscript[ptr1-1] + 1; + end; - 3: - ptr1 := ptr1 - 1; - if ptr1 < 1 then - break; - if subscript[ptr1-1] >= levels[ptr1-1] then - goto 3; - subscript[ptr1-1] := subscript[ptr1-1] + 1; - - 4: for i := ptr1 + 1 to no_in_list do subscript[i-1] := 1; ptr1 := no_in_list - 1;