fpspreadsheet: Add batch scripts to run all console demos automatically.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7994 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2021-04-15 12:19:42 +00:00
parent 860fd3ffbb
commit 78348da3ef
30 changed files with 265 additions and 100 deletions

View File

@ -25,9 +25,16 @@
<Version Value="2"/> <Version Value="2"/>
</PublishOptions> </PublishOptions>
<RunParams> <RunParams>
<local>
<CommandLineParams Value="-quit"/>
</local>
<FormatVersion Value="2"/> <FormatVersion Value="2"/>
<Modes Count="1"> <Modes Count="1">
<Mode0 Name="default"/> <Mode0 Name="default">
<local>
<CommandLineParams Value="-quit"/>
</local>
</Mode0>
</Modes> </Modes>
</RunParams> </RunParams>
<RequiredPackages Count="1"> <RequiredPackages Count="1">

View File

@ -159,6 +159,13 @@ begin
MyWorkbook.Free; MyWorkbook.Free;
WriteLn('Finished. Please open "'+TestFileXLS+'" and "' + TestFileODS + '" in your spreadsheet program.'); WriteLn('Finished. Please open "'+TestFileXLS+'" and "' + TestFileODS + '" in your spreadsheet program.');
if ParamCount = 0 then
begin
{$IFDEF MSWINDOWS}
WriteLn('Press [ENTER] to quit...');
ReadLn; ReadLn;
{$ENDIF}
end;
end. end.

View File

@ -60,6 +60,13 @@ begin
writeln('Finished.'); writeln('Finished.');
WriteLn('Please open "'+Testfile+'" in your spreadsheet program.'); WriteLn('Please open "'+Testfile+'" in your spreadsheet program.');
if ParamCount = 0 then
begin
{$IFDEF MSWINDOWS}
WriteLn('Press [ENTER] to quit...');
ReadLn; ReadLn;
{$ENDIF}
end;
end. end.

View File

@ -401,14 +401,19 @@ begin
wb.WriteToFile('test.ods', true); wb.WriteToFile('test.ods', true);
wb.WriteToFile('test.xml', true); wb.WriteToFile('test.xml', true);
if wb.ErrorMsg <> '' then begin if wb.ErrorMsg <> '' then
WriteLn(wb.ErrorMsg); WriteLn(wb.ErrorMsg);
WriteLn;
WriteLn('Press ENTER to close.');
ReadLn;
end;
finally finally
wb.Free; wb.Free;
end; end;
if ParamCount = 0 then
begin
{$IFDEF MSWINDOWS}
WriteLn('Press [ENTER] to quit...');
ReadLn;
{$ENDIF}
end;
end. end.

View File

@ -113,8 +113,13 @@ begin
workbook.Free; workbook.Free;
end; end;
WriteLn('Press ENTER to quit...'); if ParamCount = 0 then
begin
{$IFDEF MSWINDOWS}
WriteLn('Press [ENTER] to quit...');
ReadLn; ReadLn;
{$ENDIF}
end;
end. end.

View File

@ -14,9 +14,9 @@ var
i, r, c: Integer; i, r, c: Integer;
const const
image1 = '../../images/components/TSWORKBOOKSOURCE.png'; image1 = '../../../images/components/TSWORKBOOKSOURCE.png';
image2 = '../../images/components/TSWORKSHEETGRID.png'; image2 = '../../../images/components/TSWORKSHEETGRID.png';
image3 = '../../images/components/TSCELLEDIT.png'; image3 = '../../../images/components/TSCELLEDIT.png';
begin begin
Writeln('Starting program "demo_write_headerfooter_images"...'); Writeln('Starting program "demo_write_headerfooter_images"...');
@ -49,10 +49,14 @@ begin
WriteLn('Finished.'); WriteLn('Finished.');
WriteLn('Please open the files "hfimg.*" in your spreadsheet program.'); WriteLn('Please open the files "hfimg.*" in your spreadsheet program.');
{$ifdef WINDOWS}
WriteLn('Press ENTER to close this program...'); if ParamCount = 0 then
begin
{$IFDEF MSWINDOWS}
WriteLn('Press [ENTER] to close this program...');
ReadLn; ReadLn;
{$endif} {$ENDIF}
end;
finally finally
MyWorkbook.Free; MyWorkbook.Free;

View File

@ -51,13 +51,17 @@ begin
WriteLn('Finished.'); WriteLn('Finished.');
WriteLn('Please open the files "img.*" in your spreadsheet program.'); WriteLn('Please open the files "img.*" in your spreadsheet program.');
{$ifdef WINDOWS}
WriteLn('Press ENTER to close this program...');
ReadLn;
{$ENDIF}
finally finally
MyWorkbook.Free; MyWorkbook.Free;
end; end;
if ParamCount = 0 then
begin
{$IFDEF MSWINDOWS}
WriteLn('Press [ENTER] to quit...');
ReadLn;
{$ENDIF}
end;
end. end.

View File

@ -109,6 +109,12 @@ begin
book.Free; book.Free;
end; end;
if ParamCount = 0 then
begin
{$IFDEF MSWINDOWS}
WriteLn('Press [ENTER] to quit...');
ReadLn; ReadLn;
{$ENDIF}
end;
end. end.

View File

@ -46,8 +46,14 @@ begin
WriteLn('Open the files "protected.*" in your spreadsheet application.'); WriteLn('Open the files "protected.*" in your spreadsheet application.');
WriteLn('Only cell A1 can be modifed.'); WriteLn('Only cell A1 can be modifed.');
if ParamCount = 0 then
begin
{$IFDEF MSWINDOWS}
WriteLn('Press [ENTER] to quit...'); WriteLn('Press [ENTER] to quit...');
ReadLn; ReadLn;
{$ENDIF}
end;
end. end.

View File

@ -45,9 +45,16 @@ begin
writeln('Please open "'+OutputFile+'" in "fpsgrid".'); writeln('Please open "'+OutputFile+'" in "fpsgrid".');
writeLn('It must show correct calculation results in cells B1 and B2.'); writeLn('It must show correct calculation results in cells B1 and B2.');
ReadLn;
finally finally
workbook.Free; workbook.Free;
end; end;
if ParamCount = 0 then
begin
{$IFDEF MSWINDOWS}
WriteLn('Press [ENTER] to quit...');
ReadLn;
{$ENDIF}
end;
end. end.

View File

@ -101,10 +101,14 @@ begin
MyWorkbook.Free; MyWorkbook.Free;
end; end;
writeln('Finished. Please open "'+Testfile+'" in your spreadsheet program.'); WriteLn('Finished. Please open "'+Testfile+'" in your spreadsheet program.');
if ParamCount = 0 then
begin
{$IFDEF MSWINDOWS} {$IFDEF MSWINDOWS}
WriteLn('Press [ENTER] to quit.'); WriteLn('Press [ENTER] to quit...');
ReadLn; ReadLn;
{$ENDIF} {$ENDIF}
end;
end. end.

View File

@ -0,0 +1,16 @@
cell_formats\demo_write_formatting -quit
colors\demo_write_colors -quit
conditional_formatting\demo_conditional_formatting -quit
expression_parser\demo_expression_parser -quit
header_footer_images\demo_write_headerfooter_images -quit
ignore_formulas\demo_ignore_formula -quit
images\demo_write_images -quit
metadata\demo_metadata -quit
protection\demo_protection -quit
recursive_calculation\demo_recursive_calc -quit
rpn_formulas\demo_write_formula -quit
searching\demo_search -quit
sorting\demo_sorting -quit
user_defined_formulas\demo_formula_func -quit
virtual_mode\demo_virtualmode_write -quit
virtual_mode\demo_virtualmode_read -quit

View File

@ -64,10 +64,13 @@ begin
workbook.Free; workbook.Free;
end; end;
if ParamCount = 0 then
begin
{$IFDEF MSWINDOWS} {$IFDEF MSWINDOWS}
WriteLn; WriteLn;
WriteLn('Press ENTER to quit...'); WriteLn('Press [ENTER] to quit...');
ReadLn; ReadLn;
{$ENDIF} {$ENDIF}
end;
end. end.

View File

@ -412,7 +412,12 @@ begin
SortTwoColumns_TwoKeys_1; SortTwoColumns_TwoKeys_1;
SortTwoRows_TwoKeys_1; SortTwoRows_TwoKeys_1;
WriteLn('Press ENTER to quit...'); if ParamCount = 0 then
begin
{$IFDEF MSWINDOWS}
WriteLn('Press [ENTER] to quit...');
ReadLn; ReadLn;
{$ENDIF}
end;
end. end.

View File

@ -305,8 +305,14 @@ begin
WriteLn; WriteLn;
WriteLn('Open the file in Excel or OpenOffice/LibreOffice.'); WriteLn('Open the file in Excel or OpenOffice/LibreOffice.');
WriteLn('Press [ENTER] to close...');
if ParamCount = 0 then
begin
{$IFDEF MSWINDOWS}
WriteLn('Press [ENTER] to quit...');
ReadLn; ReadLn;
{$ENDIF}
end;
end. end.

View File

@ -86,7 +86,12 @@ begin
dataAnalyzer.Free; dataAnalyzer.Free;
end; end;
if ParamCount = 0 then
begin
{$IFDEF MSWINDOWS}
WriteLn('Press [ENTER] to quit...'); WriteLn('Press [ENTER] to quit...');
ReadLn; ReadLn;
{$ENDIF}
end;
end. end.

View File

@ -114,7 +114,13 @@ begin
end; end;
WriteLn(Format('Execution time: %.3f sec', [t*24*60*60])); WriteLn(Format('Execution time: %.3f sec', [t*24*60*60]));
if ParamCount = 0 then
begin
{$IFDEF MSWINDOWS}
WriteLn('Press [ENTER] to quit...'); WriteLn('Press [ENTER] to quit...');
ReadLn; ReadLn;
{$ENDIF}
end;
end. end.

View File

@ -64,9 +64,12 @@ begin
end; end;
{$ifdef WINDOWS} {$ifdef WINDOWS}
if ParamCount = 0 then
begin
WriteLn; WriteLn;
WriteLn('Press ENTER to quit...'); WriteLn('Press ENTER to quit...');
ReadLn; ReadLn;
end;
{$ENDIF} {$ENDIF}
end. end.

View File

@ -59,10 +59,13 @@ begin
MyWorkbook.Free; MyWorkbook.Free;
end; end;
if ParamCount = 0 then
begin
{$ifdef Windows} {$ifdef Windows}
WriteLn; WriteLn;
WriteLn('Press ENTER to quit...'); WriteLn('Press ENTER to quit...');
ReadLn; ReadLn;
{$endif} {$endif}
end;
end. end.

View File

@ -57,10 +57,13 @@ begin
MyWorkbook.Free; MyWorkbook.Free;
end; end;
if ParamCount = 0 then
begin
{$ifdef Windows} {$ifdef Windows}
WriteLn; WriteLn;
WriteLn('Press ENTER to quit...'); WriteLn('Press ENTER to quit...');
Readln; Readln;
{$endif} {$endif}
end;
end. end.

View File

@ -64,10 +64,13 @@ begin
MyWorkbook.Free; MyWorkbook.Free;
end; end;
if ParamCount = 0 then
begin
{$IFDEF WINDOWS} {$IFDEF WINDOWS}
WriteLn; WriteLn;
WriteLn('Press ENTER to quit...'); WriteLn('Press ENTER to quit...');
ReadLn; ReadLn;
{$ENDIF} {$ENDIF}
end;
end. end.

View File

@ -97,10 +97,13 @@ begin
workbook.Free; workbook.Free;
end; end;
if ParamCount = 0 then
begin
{$IFDEF WINDOWS} {$IFDEF WINDOWS}
WriteLn; WriteLn;
WriteLn('Press ENTER to quit...'); WriteLn('Press ENTER to quit...');
ReadLn; ReadLn;
{$ENDIF} {$ENDIF}
end;
end. end.

View File

@ -398,10 +398,14 @@ begin
WriteLn('Done.'); WriteLn('Done.');
WriteLn('File saved as "' + MyDir + 'text.xml"'); WriteLn('File saved as "' + MyDir + 'text.xml"');
if ParamCount = 0 then
begin
{$IFDEF WINDOWS} {$IFDEF WINDOWS}
WriteLn; WriteLn;
WriteLn('Press ENTER to quit.'); WriteLn('Press ENTER to quit.');
ReadLn; ReadLn;
{$ENDIF} {$ENDIF}
end;
end. end.

View File

@ -61,10 +61,13 @@ begin
MyWorkbook.Free; MyWorkbook.Free;
end; end;
if ParamCount = 0 then
begin
{$IFDEF WINDOWS} {$IFDEF WINDOWS}
WriteLn; WriteLn;
WriteLn('Press ENTER to quit...'); WriteLn('Press ENTER to quit...');
ReadLn; ReadLn;
{$ENDIF} {$ENDIF}
end;
end. end.

View File

@ -55,10 +55,13 @@ begin
// Finalization // Finalization
MyWorkbook.Free; MyWorkbook.Free;
if ParamCount = 0 then
begin
{$ifdef WINDOWS} {$ifdef WINDOWS}
WriteLn; WriteLn;
WriteLn('Press ENTER to quit...'); WriteLn('Press ENTER to quit...');
ReadLn; ReadLn;
{$ENDIF} {$ENDIF}
end;
end. end.

View File

@ -37,9 +37,12 @@ begin
WriteLn('Workbook written to "' + Mydir + 'test.xlsx' + '".'); WriteLn('Workbook written to "' + Mydir + 'test.xlsx' + '".');
if ParamCount = 0 then
begin
{$IFDEF MSWINDOWS} {$IFDEF MSWINDOWS}
WriteLn('Press ENTER to quit...'); WriteLn('Press ENTER to quit...');
ReadLn; ReadLn;
{$ENDIF} {$ENDIF}
end;
end. end.

View File

@ -73,10 +73,13 @@ begin
// Finalization // Finalization
MyWorkbook.Free; MyWorkbook.Free;
if ParamCount = 0 then
begin
{$ifdef WINDOWS} {$ifdef WINDOWS}
WriteLn; WriteLn;
WriteLn('Press ENTER to quit...'); WriteLn('Press ENTER to quit...');
ReadLn; ReadLn;
{$ENDIF} {$ENDIF}
end;
end. end.

View File

@ -55,10 +55,13 @@ begin
// Finalization // Finalization
MyWorkbook.Free; MyWorkbook.Free;
if ParamCount = 0 then
begin
{$IFDEF WINDOWS} {$IFDEF WINDOWS}
WriteLn; WriteLn;
Writeln('Press ENTER to quit...'); Writeln('Press ENTER to quit...');
ReadLn; ReadLn;
{$ENDIF} {$ENDIF}
end;
end. end.

View File

@ -0,0 +1,25 @@
csvdemo\csvwrite -quit
csvdemo\csvread -quit
excel2demo\excel2write -quit
excel2demo\excel2read -quit
excel5demo\excel5write -quit
excel5demo\excel5read -quit
excel8demo\excel8write -quit
excel8demo\excel8read -quit
excelxmldemo\excelxmlwrite -quit
excelxmldemo\excelxmlread -quit
htmldemo\htmlwrite -quit
htmldemo\htmlread -quit
ooxmldemo\ooxmlwrite -quit
ooxmldemo\ooxmlread -quit
opendocdemo\opendocwrite -quit
opendocdemo\opendocread -quit
wikitabledemo\wikitablewrite -quit

View File

@ -61,10 +61,13 @@ begin
// Finalization // Finalization
MyWorkbook.Free; MyWorkbook.Free;
if ParamCount = 0 then
begin
{$IFDEF WINDOWS} {$IFDEF WINDOWS}
WriteLn; WriteLn;
WriteLn('Press ENTER to quit...'); WriteLn('Press ENTER to quit...');
ReadLn; ReadLn;
{$ENDIF} {$ENDIF}
end;
end. end.