diff --git a/components/fpspreadsheet/examples/other/test_formula_func.lpi b/components/fpspreadsheet/examples/other/demo_formula_func.lpi similarity index 74% rename from components/fpspreadsheet/examples/other/test_formula_func.lpi rename to components/fpspreadsheet/examples/other/demo_formula_func.lpi index 4a171014d..f64220d06 100644 --- a/components/fpspreadsheet/examples/other/test_formula_func.lpi +++ b/components/fpspreadsheet/examples/other/demo_formula_func.lpi @@ -10,7 +10,7 @@ - + <Title Value="demo_formula_func"/> <UseAppBundle Value="False"/> <ResourceType Value="res"/> </General> @@ -26,8 +26,13 @@ <CompilerOptions> <Version Value="11"/> <PathDelim Value="\"/> + <Target> + <Filename Value="demo_formula_func"/> + </Target> <SearchPaths> <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="..\.."/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <CodeGeneration> <SmartLinkUnit Value="True"/> @@ -39,6 +44,9 @@ </Debugging> <LinkSmart Value="True"/> </Linking> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> </CompilerOptions> </Item2> </BuildModes> @@ -53,14 +61,14 @@ </RunParams> <RequiredPackages Count="1"> <Item1> - <PackageName Value="laz_fpspreadsheet"/> + <PackageName Value="LazUtils"/> </Item1> </RequiredPackages> <Units Count="2"> <Unit0> - <Filename Value="test_formula_func.pas"/> + <Filename Value="demo_formula_func.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="test_formula_func"/> + <UnitName Value="demo_formula_func"/> </Unit0> <Unit1> <Filename Value="financemath.pas"/> @@ -71,14 +79,27 @@ <CompilerOptions> <Version Value="11"/> <PathDelim Value="\"/> + <Target> + <Filename Value="demo_formula_func"/> + </Target> <SearchPaths> <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="..\.."/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <CodeGeneration> <Optimizations> <OptimizationLevel Value="0"/> </Optimizations> </CodeGeneration> + <Linking> + <Debugging> + <UseExternalDbgSyms Value="True"/> + </Debugging> + </Linking> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> </CompilerOptions> <Debugging> <Exceptions Count="3"> diff --git a/components/fpspreadsheet/examples/other/test_formula_func.pas b/components/fpspreadsheet/examples/other/demo_formula_func.pas similarity index 99% rename from components/fpspreadsheet/examples/other/test_formula_func.pas rename to components/fpspreadsheet/examples/other/demo_formula_func.pas index 69140b00e..2ad73f5e9 100644 --- a/components/fpspreadsheet/examples/other/test_formula_func.pas +++ b/components/fpspreadsheet/examples/other/demo_formula_func.pas @@ -13,9 +13,8 @@ Open/LibreOffice and compare). } -program test_formula_func; +program demo_formula_func; -//{$mode objfpc}{$H+} {$mode delphi}{$H+} uses @@ -25,7 +24,7 @@ uses {$ENDIF} {$ENDIF} Classes, SysUtils, - math, laz_fpspreadsheet, fpspreadsheet, xlsbiff8, fpsfunc, financemath; + math, fpspreadsheet, xlsbiff8, fpsfunc, financemath; {------------------------------------------------------------------------------} diff --git a/components/fpspreadsheet/examples/other/test_recursive_calc.lpi b/components/fpspreadsheet/examples/other/demo_recursive_calc.lpi similarity index 72% rename from components/fpspreadsheet/examples/other/test_recursive_calc.lpi rename to components/fpspreadsheet/examples/other/demo_recursive_calc.lpi index 2c0dc8bbc..6687127b3 100644 --- a/components/fpspreadsheet/examples/other/test_recursive_calc.lpi +++ b/components/fpspreadsheet/examples/other/demo_recursive_calc.lpi @@ -10,7 +10,7 @@ </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <Title Value="test_recursive_calc"/> + <Title Value="demo_recursive_calc"/> <UseAppBundle Value="False"/> <ResourceType Value="res"/> </General> @@ -26,8 +26,13 @@ <CompilerOptions> <Version Value="11"/> <PathDelim Value="\"/> + <Target> + <Filename Value="demo_recursive_calc"/> + </Target> <SearchPaths> <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="..\.."/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <CodeGeneration> <SmartLinkUnit Value="True"/> @@ -39,6 +44,9 @@ </Debugging> <LinkSmart Value="True"/> </Linking> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> </CompilerOptions> </Item2> </BuildModes> @@ -52,28 +60,41 @@ </RunParams> <RequiredPackages Count="1"> <Item1> - <PackageName Value="laz_fpspreadsheet"/> + <PackageName Value="LazUtils"/> </Item1> </RequiredPackages> <Units Count="1"> <Unit0> - <Filename Value="test_recursive_calc.pas"/> + <Filename Value="demo_recursive_calc.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="test_recursive_calc"/> + <UnitName Value="demo_recursive_calc"/> </Unit0> </Units> </ProjectOptions> <CompilerOptions> <Version Value="11"/> <PathDelim Value="\"/> + <Target> + <Filename Value="demo_recursive_calc"/> + </Target> <SearchPaths> <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="..\.."/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <CodeGeneration> <Optimizations> <OptimizationLevel Value="0"/> </Optimizations> </CodeGeneration> + <Linking> + <Debugging> + <UseExternalDbgSyms Value="True"/> + </Debugging> + </Linking> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> </CompilerOptions> <Debugging> <Exceptions Count="3"> diff --git a/components/fpspreadsheet/examples/other/test_recursive_calc.pas b/components/fpspreadsheet/examples/other/demo_recursive_calc.pas similarity index 94% rename from components/fpspreadsheet/examples/other/test_recursive_calc.pas rename to components/fpspreadsheet/examples/other/demo_recursive_calc.pas index 7b4de2459..25819f3bc 100644 --- a/components/fpspreadsheet/examples/other/test_recursive_calc.pas +++ b/components/fpspreadsheet/examples/other/demo_recursive_calc.pas @@ -4,7 +4,7 @@ Therefore calculation has to be done recursively until the independent third cell is found. } -program test_recursive_calc; +program demo_recursive_calc; {$mode objfpc}{$H+} @@ -15,7 +15,7 @@ uses {$ENDIF} {$ENDIF} Classes, - math, laz_fpspreadsheet, fpspreadsheet, fpsfunc; + math, fpspreadsheet, fpsfunc, xlsbiff8; var workbook: TsWorkbook; diff --git a/components/fpspreadsheet/examples/other/test_virtualmode.lpi b/components/fpspreadsheet/examples/other/demo_virtualmode_write.lpi similarity index 76% rename from components/fpspreadsheet/examples/other/test_virtualmode.lpi rename to components/fpspreadsheet/examples/other/demo_virtualmode_write.lpi index 71cdf11ca..de6bb423a 100644 --- a/components/fpspreadsheet/examples/other/test_virtualmode.lpi +++ b/components/fpspreadsheet/examples/other/demo_virtualmode_write.lpi @@ -10,7 +10,7 @@ </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <Title Value="test_virtualmode"/> + <Title Value="demo_virtualmode_write"/> <UseAppBundle Value="False"/> <ResourceType Value="res"/> </General> @@ -26,8 +26,13 @@ <CompilerOptions> <Version Value="11"/> <PathDelim Value="\"/> + <Target> + <Filename Value="demo_virtualmode_write"/> + </Target> <SearchPaths> <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="..\.."/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <CodeGeneration> <SmartLinkUnit Value="True"/> @@ -44,6 +49,9 @@ </Win32> </Options> </Linking> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> </CompilerOptions> </Item2> </BuildModes> @@ -57,12 +65,12 @@ </RunParams> <RequiredPackages Count="1"> <Item1> - <PackageName Value="laz_fpspreadsheet"/> + <PackageName Value="LazUtils"/> </Item1> </RequiredPackages> <Units Count="1"> <Unit0> - <Filename Value="test_virtualmode.lpr"/> + <Filename Value="demo_virtualmode_write.lpr"/> <IsPartOfProject Value="True"/> </Unit0> </Units> @@ -70,8 +78,13 @@ <CompilerOptions> <Version Value="11"/> <PathDelim Value="\"/> + <Target> + <Filename Value="demo_virtualmode_write"/> + </Target> <SearchPaths> <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="..\.."/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <CodeGeneration> <Optimizations> @@ -80,9 +93,12 @@ </CodeGeneration> <Linking> <Debugging> - <UseHeaptrc Value="True"/> + <UseExternalDbgSyms Value="True"/> </Debugging> </Linking> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> </CompilerOptions> <Debugging> <Exceptions Count="3"> diff --git a/components/fpspreadsheet/examples/other/test_virtualmode.lpr b/components/fpspreadsheet/examples/other/demo_virtualmode_write.lpr similarity index 97% rename from components/fpspreadsheet/examples/other/test_virtualmode.lpr rename to components/fpspreadsheet/examples/other/demo_virtualmode_write.lpr index 04ac28698..e77f53d98 100644 --- a/components/fpspreadsheet/examples/other/test_virtualmode.lpr +++ b/components/fpspreadsheet/examples/other/demo_virtualmode_write.lpr @@ -1,4 +1,4 @@ -program test_virtualmode; +program demo_virtualmode_write; {$mode objfpc}{$H+} @@ -10,7 +10,7 @@ uses {$ENDIF} Classes, SysUtils, lazutf8, - variants, laz_fpspreadsheet, fpspreadsheet, xlsbiff2, xlsbiff5, xlsbiff8, xlsxooxml; + variants, fpspreadsheet, xlsbiff2, xlsbiff5, xlsbiff8, xlsxooxml; type TDataProvider = class diff --git a/components/fpspreadsheet/examples/other/test_write_formatting.lpi b/components/fpspreadsheet/examples/other/demo_write_formatting.lpi similarity index 81% rename from components/fpspreadsheet/examples/other/test_write_formatting.lpi rename to components/fpspreadsheet/examples/other/demo_write_formatting.lpi index 0e51e89fc..35a109e19 100644 --- a/components/fpspreadsheet/examples/other/test_write_formatting.lpi +++ b/components/fpspreadsheet/examples/other/demo_write_formatting.lpi @@ -27,10 +27,11 @@ <Version Value="11"/> <PathDelim Value="\"/> <Target> - <Filename Value="test_write_formatting"/> + <Filename Value="demo_write_formatting"/> </Target> <SearchPaths> <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="..\.."/> <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <CodeGeneration> @@ -43,6 +44,9 @@ </Debugging> <LinkSmart Value="True"/> </Linking> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> </CompilerOptions> </Item2> </BuildModes> @@ -58,14 +62,14 @@ </RunParams> <RequiredPackages Count="1"> <Item1> - <PackageName Value="laz_fpspreadsheet"/> + <PackageName Value="LazUtils"/> </Item1> </RequiredPackages> <Units Count="1"> <Unit0> - <Filename Value="test_write_formatting.pas"/> + <Filename Value="demo_write_formatting.pas"/> <IsPartOfProject Value="True"/> - <UnitName Value="test_write_formatting"/> + <UnitName Value="demo_write_formatting"/> </Unit0> </Units> </ProjectOptions> @@ -77,6 +81,7 @@ </Target> <SearchPaths> <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="..\.."/> <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <CodeGeneration> @@ -84,5 +89,13 @@ <OptimizationLevel Value="0"/> </Optimizations> </CodeGeneration> + <Linking> + <Debugging> + <UseExternalDbgSyms Value="True"/> + </Debugging> + </Linking> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> </CompilerOptions> </CONFIG> diff --git a/components/fpspreadsheet/examples/other/test_write_formatting.pas b/components/fpspreadsheet/examples/other/demo_write_formatting.pas similarity index 97% rename from components/fpspreadsheet/examples/other/test_write_formatting.pas rename to components/fpspreadsheet/examples/other/demo_write_formatting.pas index b0a1221e7..238370685 100644 --- a/components/fpspreadsheet/examples/other/test_write_formatting.pas +++ b/components/fpspreadsheet/examples/other/demo_write_formatting.pas @@ -7,13 +7,12 @@ Adds formatting to the file AUTHORS: Felipe Monteiro de Carvalho } -program test_write_formatting; +program demo_write_formatting; {$mode delphi}{$H+} uses - Classes, SysUtils, fpspreadsheet, xlsbiff8, fpsopendocument, - laz_fpspreadsheet; + Classes, SysUtils, fpspreadsheet, xlsbiff8, fpsopendocument; var MyWorkbook: TsWorkbook; @@ -161,6 +160,9 @@ end; const TestFile='test3.odt'; + +{$R *.res} + begin writeln('Starting program.'); MyDir := ExtractFilePath(ParamStr(0)); diff --git a/components/fpspreadsheet/examples/other/test_write_formula.lpi b/components/fpspreadsheet/examples/other/demo_write_formula.lpi similarity index 81% rename from components/fpspreadsheet/examples/other/test_write_formula.lpi rename to components/fpspreadsheet/examples/other/demo_write_formula.lpi index b0b388d69..998b43bca 100644 --- a/components/fpspreadsheet/examples/other/test_write_formula.lpi +++ b/components/fpspreadsheet/examples/other/demo_write_formula.lpi @@ -9,7 +9,7 @@ </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <Title Value="test_write_formula"/> + <Title Value="demo_write_formula"/> <ResourceType Value="res"/> <UseXPManifest Value="True"/> </General> @@ -25,10 +25,11 @@ <CompilerOptions> <Version Value="11"/> <Target> - <Filename Value="test_write_formula"/> + <Filename Value="demo_write_formula"/> </Target> <SearchPaths> <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="../.."/> <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <CodeGeneration> @@ -41,6 +42,9 @@ </Debugging> <LinkSmart Value="True"/> </Linking> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> </CompilerOptions> </Item2> </BuildModes> @@ -57,12 +61,12 @@ </RunParams> <RequiredPackages Count="1"> <Item1> - <PackageName Value="laz_fpspreadsheet"/> + <PackageName Value="LazUtils"/> </Item1> </RequiredPackages> <Units Count="1"> <Unit0> - <Filename Value="test_write_formula.pas"/> + <Filename Value="demo_write_formula.pas"/> <IsPartOfProject Value="True"/> </Unit0> </Units> @@ -70,10 +74,11 @@ <CompilerOptions> <Version Value="11"/> <Target> - <Filename Value="test_write_formula"/> + <Filename Value="demo_write_formula"/> </Target> <SearchPaths> <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="../.."/> <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <CodeGeneration> @@ -81,6 +86,14 @@ <OptimizationLevel Value="0"/> </Optimizations> </CodeGeneration> + <Linking> + <Debugging> + <UseExternalDbgSyms Value="True"/> + </Debugging> + </Linking> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> </CompilerOptions> <Debugging> <Exceptions Count="3"> diff --git a/components/fpspreadsheet/examples/other/test_write_formula.pas b/components/fpspreadsheet/examples/other/demo_write_formula.pas similarity index 96% rename from components/fpspreadsheet/examples/other/test_write_formula.pas rename to components/fpspreadsheet/examples/other/demo_write_formula.pas index 9ca45972d..895456d0c 100644 --- a/components/fpspreadsheet/examples/other/test_write_formula.pas +++ b/components/fpspreadsheet/examples/other/demo_write_formula.pas @@ -5,14 +5,13 @@ Demonstrates how to write a formula using the fpspreadsheet library AUTHORS: Felipe Monteiro de Carvalho } -program test_write_formula; +program demo_write_formula; {$mode delphi}{$H+} uses Classes, SysUtils, - fpspreadsheet, xlsbiff5, xlsbiff8, fpsopendocument, - laz_fpspreadsheet; + fpspreadsheet, xlsbiff5, xlsbiff8, fpsopendocument; var MyWorkbook: TsWorkbook; @@ -86,6 +85,9 @@ end; const TestFile='test_formula.xls'; + +{$R *.res} + begin writeln('Starting program.'); MyDir := ExtractFilePath(ParamStr(0)); diff --git a/components/fpspreadsheet/examples/other/readme.txt b/components/fpspreadsheet/examples/other/readme.txt new file mode 100644 index 000000000..35562940f --- /dev/null +++ b/components/fpspreadsheet/examples/other/readme.txt @@ -0,0 +1,17 @@ +This folder contains various demo applications: + +- demo_formula_func: shows how a user-provided function can be registered in + fpspreadsheet for usage in rpn formulas. The example covers some financial + functions. + +- demo_recursive_calc: demonstrates recursive calculation of formulas. All + formulas in this demo depend on the result of the formula in the next cell, + except for the last cell. When the formula in the first cell is calculated + recursive calculation of the other cells is requested. + +- demo_virtualmode_writing: demonstrates how the virtual mode of the workbook + can be used to create huge spreadsheet files. + +- demo_write_formatting: shows some simple cell formatting + +- demo_write_formula: shows some rpn formulas