From aac25fbe8d6697f5100d7bd3efcd109baa65eb4c Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Thu, 29 Oct 2020 22:48:02 +0000 Subject: [PATCH] LazStats: Less hints and warnings git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7829 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../analysis/comparisons/onecaseanovaunit.pas | 2 +- .../analysis/descriptive/groupfrequnit.pas | 2 +- .../analysis/descriptive/smoothdataunit.pas | 5 ++- .../measurement_programs/gradebookunit.pas | 2 +- .../measurement_programs/gradingunit.pas | 4 +- .../measurement_programs/polydifunit.pas | 2 +- .../multiple_regression/twoslsunit.pas | 43 +++++++++++++------ .../analysis/multiple_regression/wlsunit.pas | 6 +-- .../analysis/multivariate/singlelinkunit.pas | 2 +- .../analysis/nonparametric/friedmanunit.pas | 2 +- .../nonparametric/kaplanmeierunit.pas | 7 +-- .../analysis/nonparametric/riditunit.pas | 26 +++++------ .../analysis/nonparametric/srhtestunit.pas | 2 +- .../source/forms/misc/dictionaryunit.pas | 4 +- .../source/forms/simulations/fprobunit.pas | 3 +- 15 files changed, 62 insertions(+), 50 deletions(-) diff --git a/applications/lazstats/source/forms/analysis/comparisons/onecaseanovaunit.pas b/applications/lazstats/source/forms/analysis/comparisons/onecaseanovaunit.pas index 309d4fa8e..f3630fdcf 100644 --- a/applications/lazstats/source/forms/analysis/comparisons/onecaseanovaunit.pas +++ b/applications/lazstats/source/forms/analysis/comparisons/onecaseanovaunit.pas @@ -7,7 +7,7 @@ interface uses Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, Buttons, ExtCtrls, - MainUnit, Globals, FunctionsLib, OutputUnit, DataProcs, GraphLib, + MainUnit, Globals, OutputUnit, DataProcs, GraphLib, ANOVATestsUnit, contexthelpunit; type diff --git a/applications/lazstats/source/forms/analysis/descriptive/groupfrequnit.pas b/applications/lazstats/source/forms/analysis/descriptive/groupfrequnit.pas index 2c2296605..e2000386d 100644 --- a/applications/lazstats/source/forms/analysis/descriptive/groupfrequnit.pas +++ b/applications/lazstats/source/forms/analysis/descriptive/groupfrequnit.pas @@ -29,7 +29,7 @@ type procedure GrpInBtnClick(Sender: TObject); procedure GrpOutBtnClick(Sender: TObject); procedure VarListDblClick(Sender: TObject); - procedure VarListSelectionChange(Sender: TObject; User: boolean); + procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean); private FLabelsSource: TListChartSource; diff --git a/applications/lazstats/source/forms/analysis/descriptive/smoothdataunit.pas b/applications/lazstats/source/forms/analysis/descriptive/smoothdataunit.pas index 9cf52b11c..81a90d8fd 100644 --- a/applications/lazstats/source/forms/analysis/descriptive/smoothdataunit.pas +++ b/applications/lazstats/source/forms/analysis/descriptive/smoothdataunit.pas @@ -35,7 +35,7 @@ type procedure HelpBtnClick(Sender: TObject); procedure ResetBtnClick(Sender: TObject); procedure VarInBtnClick(Sender: TObject); - procedure VarListSelectionChange(Sender: TObject; User: boolean); + procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean); procedure VarOutBtnClick(Sender: TObject); private { private declarations } @@ -69,7 +69,8 @@ end; procedure TDataSmoothingForm.ComputeBtnClick(Sender: TObject); var - DataPts, OutPts: DblDyneVec; + DataPts: DblDyneVec = nil; + OutPts: DblDyneVec = nil; N, Reps, i, j, VarCol: integer; VarLabel, strValue: string; begin diff --git a/applications/lazstats/source/forms/analysis/measurement_programs/gradebookunit.pas b/applications/lazstats/source/forms/analysis/measurement_programs/gradebookunit.pas index 926bd4d37..2c23f89d1 100644 --- a/applications/lazstats/source/forms/analysis/measurement_programs/gradebookunit.pas +++ b/applications/lazstats/source/forms/analysis/measurement_programs/gradebookunit.pas @@ -105,7 +105,7 @@ implementation uses Math, - Utils, MatrixUnit; + MatrixUnit; { TGradebookFrm } diff --git a/applications/lazstats/source/forms/analysis/measurement_programs/gradingunit.pas b/applications/lazstats/source/forms/analysis/measurement_programs/gradingunit.pas index 22d5795d4..800fe5e49 100644 --- a/applications/lazstats/source/forms/analysis/measurement_programs/gradingunit.pas +++ b/applications/lazstats/source/forms/analysis/measurement_programs/gradingunit.pas @@ -51,7 +51,7 @@ type procedure FormShow(Sender: TObject); procedure LoadBtnClick(Sender: TObject); procedure LowScoreGridKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); + {%H-}Shift: TShiftState); procedure ResetBtnClick(Sender: TObject); procedure SaveBtnClick(Sender: TObject); private @@ -73,7 +73,7 @@ implementation uses Math, - Utils, MatrixUnit, GradebookUnit; + MatrixUnit, GradebookUnit; { TGradingFrm } diff --git a/applications/lazstats/source/forms/analysis/measurement_programs/polydifunit.pas b/applications/lazstats/source/forms/analysis/measurement_programs/polydifunit.pas index 1b7c4d928..9a93ed949 100644 --- a/applications/lazstats/source/forms/analysis/measurement_programs/polydifunit.pas +++ b/applications/lazstats/source/forms/analysis/measurement_programs/polydifunit.pas @@ -84,7 +84,7 @@ type procedure NextBtnClick(Sender: TObject); procedure ResetBtnClick(Sender: TObject); procedure UpBoundEditEditingDone(Sender: TObject); - procedure VarListSelectionChange(Sender: TObject; User: boolean); + procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean); private { private declarations } FAutoSized: Boolean; diff --git a/applications/lazstats/source/forms/analysis/multiple_regression/twoslsunit.pas b/applications/lazstats/source/forms/analysis/multiple_regression/twoslsunit.pas index b506228b6..8db155607 100644 --- a/applications/lazstats/source/forms/analysis/multiple_regression/twoslsunit.pas +++ b/applications/lazstats/source/forms/analysis/multiple_regression/twoslsunit.pas @@ -41,7 +41,7 @@ type procedure DepOutClick(Sender: TObject); procedure ExpInClick(Sender: TObject); procedure ExplanatoryListDblClick(Sender: TObject); - procedure ExplanatoryListSelectionChange(Sender: TObject; User: boolean); + procedure ExplanatoryListSelectionChange(Sender: TObject; {%H-}User: boolean); procedure ExpOutClick(Sender: TObject); procedure InstInClick(Sender: TObject); procedure InstOutClick(Sender: TObject); @@ -99,21 +99,36 @@ end; procedure TTwoSLSForm.Compute; var - i, j, k, DepCol, NoInst, NoExp, NoProx, Noindep : integer; - IndepCols, ProxSrcCols, ExpCols, InstCols, ProxCols : IntDyneVec; - DepProx, NCases, col, counter : integer; - ExpLabels, InstLabels, ProxLabels, RowLabels, ProxSrcLabels : StrDyneVec; - X, Y : double; - Means, Variances, StdDevs, BWeights : DblDyneVec; - BetaWeights, BStdErrs, Bttests, tprobs : DblDyneVec; + IndepCols: IntDyneVec = nil; + ProxSrcCols: IntDyneVec = nil; + ExpCols: IntDyneVec = nil; + InstCols: IntDyneVec = nil; + ProxCols: IntDyneVec = nil; + ExpLabels: StrDyneVec = nil; + InstLabels: StrDyneVec = nil; + ProxLabels: StrDyneVec = nil; + RowLabels: StrDyneVec = nil; + ProxSrcLabels: StrDyneVec = nil; + Means: DblDyneVec = nil; + Variances: DblDyneVec = nil; + StdDevs: DblDyneVec = nil; + BWeights: DblDyneVec = nil; + BetaWeights: DblDyneVec = nil; + BStdErrs: DblDyneVec = nil; + Bttests: DblDyneVec = nil; + tProbs: DblDyneVec = nil; + R2: Double = 0.0; + stdErrEst: Double = 0.0; + + i, j, k, DepCol, NoInst, NoExp, NoProx, Noindep : integer; + DepProx, NCases, col, counter : integer; + X, Y : double; // ProxVals : DblDyneMat; - PrintDesc: Boolean; + PrintDesc: Boolean; // PrintCorrs, PrintInverse, PrintCoefs, SaveCorrs : boolean; - found : boolean; - lReport: TStrings; - errorcode: Boolean = false; - R2: Double = 0.0; - stdErrEst: Double = 0.0; + found : boolean; + lReport: TStrings; + errorcode: Boolean = false; begin if DepVarEdit.Text = '' then begin diff --git a/applications/lazstats/source/forms/analysis/multiple_regression/wlsunit.pas b/applications/lazstats/source/forms/analysis/multiple_regression/wlsunit.pas index e39486950..cdee4c349 100644 --- a/applications/lazstats/source/forms/analysis/multiple_regression/wlsunit.pas +++ b/applications/lazstats/source/forms/analysis/multiple_regression/wlsunit.pas @@ -93,7 +93,7 @@ type const ARowLabels: StrDyneVec; const xValues: DblDyneMat; out AWeights: DblDyneVec; const ABadRows: IntDyneVec): Boolean; - function Process_WeightedRegression(AIndepCols: IntDyneVec; + function Process_WeightedRegression( const ARowLabels: StrDyneVec; const xValues: DblDyneMat; const yValues: DblDyneVec; const AWeights: DblDyneVec; SubtractMeans: Boolean): Boolean; @@ -301,7 +301,7 @@ begin useOrigin := Origin2Chk.Checked; // Do the weighted regression, finally - Process_WeightedRegression(indepCols, RowLabels, xValues, yValues, weights, useOrigin); + Process_WeightedRegression(RowLabels, xValues, yValues, weights, useOrigin); end; @@ -840,7 +840,7 @@ begin end; -function TWLSForm.Process_WeightedRegression(AIndepCols: IntDyneVec; +function TWLSForm.Process_WeightedRegression( const ARowLabels: StrDyneVec; const xValues: DblDyneMat; const yValues: DblDyneVec; const AWeights: DblDyneVec; SubtractMeans: Boolean): Boolean; var diff --git a/applications/lazstats/source/forms/analysis/multivariate/singlelinkunit.pas b/applications/lazstats/source/forms/analysis/multivariate/singlelinkunit.pas index 86760ac9b..86d024c28 100644 --- a/applications/lazstats/source/forms/analysis/multivariate/singlelinkunit.pas +++ b/applications/lazstats/source/forms/analysis/multivariate/singlelinkunit.pas @@ -63,7 +63,7 @@ implementation uses Math, - Utils, MatrixUnit; + {%H-}Utils, MatrixUnit; { TSingleLinkFrm } diff --git a/applications/lazstats/source/forms/analysis/nonparametric/friedmanunit.pas b/applications/lazstats/source/forms/analysis/nonparametric/friedmanunit.pas index 0d78e9723..786a9d254 100644 --- a/applications/lazstats/source/forms/analysis/nonparametric/friedmanunit.pas +++ b/applications/lazstats/source/forms/analysis/nonparametric/friedmanunit.pas @@ -52,7 +52,7 @@ implementation {$R *.lfm} uses - Math, Utils; + Utils; { TFriedmanFrm } diff --git a/applications/lazstats/source/forms/analysis/nonparametric/kaplanmeierunit.pas b/applications/lazstats/source/forms/analysis/nonparametric/kaplanmeierunit.pas index fd0d1ea84..0e19458be 100644 --- a/applications/lazstats/source/forms/analysis/nonparametric/kaplanmeierunit.pas +++ b/applications/lazstats/source/forms/analysis/nonparametric/kaplanmeierunit.pas @@ -233,14 +233,9 @@ var CntrlProp: DblDyneVec = nil; CumPropExp: DblDyneVec = nil; CumPropCntrl: DblDyneVec = nil; - TimeLabel, GroupLabel, DeathsLabel: string; lReport: TStrings; begin - // get variable columns and labels - TimeLabel := TimeVarEdit.Text; - GroupLabel := GroupVarEdit.Text; - DeathsLabel := EventVarEdit.Text; - + // Get variable columns TimeCol := GetVariableIndex(OS3MainFrm.DataGrid, TimeVarEdit.Text); DeathsCol := GetVariableIndex(OS3MainFrm.DataGrid, EventVarEdit.Text); GroupCol := GetVariableIndex(OS3MainFrm.DataGrid, GroupVarEdit.Text); diff --git a/applications/lazstats/source/forms/analysis/nonparametric/riditunit.pas b/applications/lazstats/source/forms/analysis/nonparametric/riditunit.pas index e907f74bd..69b845c23 100644 --- a/applications/lazstats/source/forms/analysis/nonparametric/riditunit.pas +++ b/applications/lazstats/source/forms/analysis/nonparametric/riditunit.pas @@ -51,7 +51,7 @@ type NoToAnalyze: integer; Freq: IntDyneMat; Props: DblDyneMat; NoRows: integer; AReport: TStrings); procedure VarListDblClick(Sender: TObject); - procedure VarListSelectionChange(Sender: TObject; User: boolean); + procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean); private @@ -101,16 +101,16 @@ procedure TRIDITForm.Analyze(RefCol : integer; ColNoSelected : IntDyneVec; Props : DblDyneMat; NoRows : integer; AReport: TStrings); var - probdists : DblDyneMat; - refprob : DblDyneMat; - sizes : DblDyneVec; - meanridits : DblDyneVec; - Cratios : DblDyneVec; + probdists : DblDyneMat = nil; + refprob : DblDyneMat = nil; + sizes : DblDyneVec = nil; + meanridits : DblDyneVec = nil; + StdErr : DblDyneVec = nil; + Cratios : DblDyneVec = nil; OverMeanRidit : double; chisquare : double; probchi : double; alpha : double; - StdErr : DblDyneVec; Bonferroni : double; i, j : integer; outline : string; @@ -302,15 +302,17 @@ end; procedure TRIDITForm.Compute; var + Prop: DblDyneMat = nil; + Expected: DblDyneMat = nil; + CellChi: DblDyneMat = nil; + ColNoSelected: IntDyneVec = nil; + Freq : IntDyneMat = nil; + RowLabels: StrDyneVec = nil; + ColLabels: StrDyneVec = nil; AllRefs : boolean; i, j, RowNo, RefColNo, NoToAnalyze : integer; Row, Col, Ncases, Nrows, Ncols, df : integer; - RowLabels, ColLabels : StrDyneVec; - ColNoSelected : IntDyneVec = nil; - cellstring : string; outline : string; - Freq : IntDyneMat = nil; - Prop, Expected, CellChi : DblDyneMat; ChiSquare, ProbChi : double; yates : boolean; Adjchisqr, Adjprobchi: double; diff --git a/applications/lazstats/source/forms/analysis/nonparametric/srhtestunit.pas b/applications/lazstats/source/forms/analysis/nonparametric/srhtestunit.pas index 1711a0c27..721b4bb2b 100644 --- a/applications/lazstats/source/forms/analysis/nonparametric/srhtestunit.pas +++ b/applications/lazstats/source/forms/analysis/nonparametric/srhtestunit.pas @@ -614,7 +614,7 @@ procedure TSRHTest.TwoWayPlot(Sender: TObject); var i, j : integer; maxmean, XBar : double; - XValue : DblDyneVec; + XValue : DblDyneVec = nil; title : string; plottype : integer; setstring : string[11]; diff --git a/applications/lazstats/source/forms/misc/dictionaryunit.pas b/applications/lazstats/source/forms/misc/dictionaryunit.pas index 2908e61e5..d3727c821 100644 --- a/applications/lazstats/source/forms/misc/dictionaryunit.pas +++ b/applications/lazstats/source/forms/misc/dictionaryunit.pas @@ -28,8 +28,8 @@ type CancelBtn: TButton; DictGrid: TStringGrid; Panel1: TPanel; - procedure DictGridKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure DictGridSelectEditor(Sender: TObject; aCol, aRow: Integer; + procedure DictGridKeyDown(Sender: TObject; var Key: Word; {%H-}Shift: TShiftState); + procedure DictGridSelectEditor(Sender: TObject; aCol, {%H-}aRow: Integer; var Editor: TWinControl); procedure DictGridSetEditText(Sender: TObject; ACol, ARow: Integer; const Value: string); diff --git a/applications/lazstats/source/forms/simulations/fprobunit.pas b/applications/lazstats/source/forms/simulations/fprobunit.pas index a7ba5074a..30d73f217 100644 --- a/applications/lazstats/source/forms/simulations/fprobunit.pas +++ b/applications/lazstats/source/forms/simulations/fprobunit.pas @@ -6,8 +6,7 @@ interface uses Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, - StdCtrls, ExtCtrls, - Functionslib; + StdCtrls, ExtCtrls; type