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