LazStats: Fix compilation.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7684 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-09-22 08:34:23 +00:00
parent 5cfa3c5c6c
commit d9150100d0

View File

@ -236,15 +236,15 @@ begin
end;
filename := ChangeFileExt(OS3MainFrm.FileNameEdit.Text, '.laz');
OS3MainFrm.SaveDialog1.InitialDir := ExtractFileDir(filename);
OS3MainFrm.SaveDialog1.FileName := ExtractFileName(filename);
OS3MainFrm.SaveDialog1.DefaultExt := '.laz';
OS3MainFrm.SaveDialog.InitialDir := ExtractFileDir(filename);
OS3MainFrm.SaveDialog.FileName := ExtractFileName(filename);
OS3MainFrm.SaveDialog.DefaultExt := '.laz';
// OS3MainFrm.SaveDialog1.Filter := 'LazStats (*.laz)|*.laz;*.LAZ|Tab (*.tab)|*.tab;*.TAB|space (*.spc)|*.spc;*.SPC';
OS3MainFrm.SaveDialog1.Filter := 'LazStats (*.laz)|*.laz;*.LAZ|All files (*.*)|*.*';
OS3MainFrm.SaveDialog1.FilterIndex := 1;
if OS3MainFrm.SaveDialog1.Execute then
OS3MainFrm.SaveDialog.Filter := 'LazStats (*.laz)|*.laz;*.LAZ|All files (*.*)|*.*';
OS3MainFrm.SaveDialog.FilterIndex := 1;
if OS3MainFrm.SaveDialog.Execute then
begin
filename := ExpandFileName(OS3MainFrm.SaveDialog1.FileName);
filename := ExpandFileName(OS3MainFrm.SaveDialog.FileName);
OS3MainFrm.FileNameEdit.Text := filename;
AssignFile(F, filename);
Rewrite(F);
@ -278,7 +278,7 @@ end;
procedure OpenOS2File;
begin
with OS3MainFrm.OpenDialog1 do
with OS3MainFrm.OpenDialog do
begin
DefaultExt := '.laz';
Filter := 'LazStats files (*.laz)|*.laz;*.LAZ|All files (*.*)|*.*';
@ -616,7 +616,7 @@ begin
exit;
end;
with OS3MainFrm.OpenDialog1 do
with OS3MainFrm.OpenDialog do
begin
Filter := AFilter;
FilterIndex := 1;
@ -627,7 +627,7 @@ begin
FileName := ChangeFileExt(FileName, ADefaultExt);
end;
end;
if OS3MainFrm.OpenDialog1.Execute then
if OS3MainFrm.OpenDialog.Execute then
begin
res := MessageDlg('Are variable labels included?', mtConfirmation, [mbYes, mbNo, mbCancel], 0);
if res = mrCancel then
@ -638,9 +638,9 @@ begin
if labelsInc then row := 0 else row := 1;
col := 1;
AssignFile(F, OS3MainFrm.OpenDialog1.FileName); { File selected in dialog box }
AssignFile(F, OS3MainFrm.OpenDialog.FileName); { File selected in dialog box }
Reset(F);
OS3MainFrm.FileNameEdit.Text := OS3MainFrm.OpenDialog1.FileName;
OS3MainFrm.FileNameEdit.Text := OS3MainFrm.OpenDialog.FileName;
s := '';
while not EOF(F) do
@ -864,7 +864,7 @@ var
F: TextFile;
i, j: integer;
begin
with OS3MainFrm.SaveDialog1 do begin
with OS3MainFrm.SaveDialog do begin
Filter := AFilter;
FilterIndex := 1;
DefaultExt := ADefaultExt;
@ -874,9 +874,9 @@ begin
FileName := ChangeFileExt(FileName, ADefaultExt);
end;
end;
if OS3MainFrm.SaveDialog1.Execute then
if OS3MainFrm.SaveDialog.Execute then
begin
namestr := OS3MainFrm.SaveDialog1.FileName;
namestr := OS3MainFrm.SaveDialog.FileName;
Assign(F, namestr);
ReWrite(F);
for i := 0 to NoCases do // wp: why not NoCases-1 ?
@ -1037,7 +1037,7 @@ begin
begin
fileExt := Lowercase(ExtractFileExt(AFilename));
OS3MainFrm.FileNameEdit.Text := AFilename;
OS3MainFrm.OpenDialog1.FileName := AFilename;
OS3MainFrm.OpenDialog.FileName := AFilename;
case fileExt of
'.csv': OpenCommaFile;
'.tab': OpenTabFile;
@ -1399,66 +1399,67 @@ begin
Assert(OS3MainFrm <> nil);
Assert(DictionaryFrm <> nil);
DictLoaded := false;
OS3MainFrm.OpenDialog1.DefaultExt := '.OS2';
OS3MainFrm.OpenDialog1.Filter := 'OpenStat2 (*.OS2)|*.OS2|Tab (*.tab)|*.TAB|space (*.SPC)|*.SPC|All files (*.*)|*.*';
OS3MainFrm.OpenDialog1.FilterIndex := 1;
if OS3MainFrm.OpenDialog1.Execute then
begin
filename := OS3MainFrm.OpenDialog1.FileName;
OS3MainFrm.FileNameEdit.Text := filename;
AssignFile(F,filename);
Reset(F);
Readln(F,NRows);
readln(F,NCols);
DictLoaded := false;
OS3MainFrm.OpenDialog.DefaultExt := '.OS2';
OS3MainFrm.OpenDialog.Filter := 'OpenStat2 (*.OS2)|*.OS2|Tab (*.tab)|*.TAB|space (*.SPC)|*.SPC|All files (*.*)|*.*';
OS3MainFrm.OpenDialog.FilterIndex := 1;
if OS3MainFrm.OpenDialog.Execute then
begin
filename := OS3MainFrm.OpenDialog.FileName;
OS3MainFrm.FileNameEdit.Text := filename;
AssignFile(F,filename);
Reset(F);
Readln(F,NRows);
Readln(F,NCols);
// initialize the dictionary grid for NCols of variables
// using the default formats (protective measure in case of
// a screw-up where the dictionary was damaged
DictionaryFrm.DictGrid.ColCount := 8;
DictionaryFrm.DictGrid.RowCount := NRows+1;
for i := 1 to NCols do
begin
DictionaryFrm.DictGrid.Cells[0,i] := IntToStr(i);
DictionaryFrm.DictGrid.Cells[1,i] := 'VAR.' + IntToStr(i);
DictionaryFrm.DictGrid.Cells[2,i] := 'VARIABLE ' + IntToStr(i);
DictionaryFrm.DictGrid.Cells[3,i] := '8';
DictionaryFrm.DictGrid.Cells[4,i] := 'F';
DictionaryFrm.DictGrid.Cells[5,i] := '2';
DictionaryFrm.DictGrid.Cells[6,i] := ' ';
DictionaryFrm.DictGrid.Cells[7,i] := 'L';
end;
DictionaryFrm.DescMemo.Clear;
// initialize the dictionary grid for NCols of variables
// using the default formats (protective measure in case of
// a screw-up where the dictionary was damaged
DictionaryFrm.DictGrid.ColCount := 8;
DictionaryFrm.DictGrid.RowCount := NRows+1;
for i := 1 to NCols do
begin
DictionaryFrm.DictGrid.Cells[0,i] := IntToStr(i);
DictionaryFrm.DictGrid.Cells[1,i] := 'VAR.' + IntToStr(i);
DictionaryFrm.DictGrid.Cells[2,i] := 'VARIABLE ' + IntToStr(i);
DictionaryFrm.DictGrid.Cells[3,i] := '8';
DictionaryFrm.DictGrid.Cells[4,i] := 'F';
DictionaryFrm.DictGrid.Cells[5,i] := '2';
DictionaryFrm.DictGrid.Cells[6,i] := ' ';
DictionaryFrm.DictGrid.Cells[7,i] := 'L';
end;
DictionaryFrm.DescMemo.Clear;
// Now read grid data
OS3MainFrm.DataGrid.RowCount := NRows + 1;
OS3MainFrm.DataGrid.ColCount := NCols + 1;
OS3MainFrm.NoCasesEdit.Text := IntToStr(NRows);
OS3MainFrm.NoVarsEdit.Text := IntToStr(NCols);
NoVariables := NCols;
NoCases := NRows;
// Labels in row 0
for i := 0 to NRows do
begin
// case no. in col. 0
for j := 0 to NCols do
begin
Readln(F,astr);
OS3MainFrm.DataGrid.Cells[j,i] := astr;
end;
end;
CloseFile(F);
OS3MainFrm.DataGrid.Cells[0,0] := 'CASE/VAR.';
// Now read grid data
OS3MainFrm.DataGrid.RowCount := NRows + 1;
OS3MainFrm.DataGrid.ColCount := NCols + 1;
OS3MainFrm.NoCasesEdit.Text := IntToStr(NRows);
OS3MainFrm.NoVarsEdit.Text := IntToStr(NCols);
NoVariables := NCols;
NoCases := NRows;
// copy column names into the data dictionary.
for i := 1 to NCols do
begin
DictionaryFrm.DictGrid.Cells[1,i] := OS3MainFrm.DataGrid.Cells[i,0];
VarDefined[i] := true;
end;
DictionaryFrm.ShowModal;
FormatGrid;
end;
// Labels in row 0
for i := 0 to NRows do
begin
// case no. in col. 0
for j := 0 to NCols do
begin
Readln(F,astr);
OS3MainFrm.DataGrid.Cells[j,i] := astr;
end;
end;
CloseFile(F);
OS3MainFrm.DataGrid.Cells[0,0] := 'CASE/VAR.';
// copy column names into the data dictionary.
for i := 1 to NCols do
begin
DictionaryFrm.DictGrid.Cells[1,i] := OS3MainFrm.DataGrid.Cells[i,0];
VarDefined[i] := true;
end;
DictionaryFrm.ShowModal;
FormatGrid;
end;
end;
procedure ClearGrid;