diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..52b8968
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,165 @@
+# Changelog
+
+This is the change log for the _DelphiDabbler Code Snippets Database_ collection.
+
+From v2.0.0 all notable changes to this project will be documented in this file.
+
+> No change log was kept for version 1 of the collection.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## v2.3.0 of 2025/09/13
+
+* Updated the collection specification:
+ * Added snippet properties to enable recording of compilation results with Delphi 13 (issue [62](https://github.com/delphidabbler/code-snippets/issues/62)).
+ * Deprecated compiler results with value `W` (issue [63](https://github.com/delphidabbler/code-snippets/issues/63)).
+* Changes were made to the _Structures_ category:
+ * Added a new `TIntegerRange` advanced record (issue [56](https://github.com/delphidabbler/code-snippets/issues/56)).
+ * Fixed an error in the description of the `Range` snippet.
+ * Added a warning to the `TRangeEx` advanced record to note potentially buggy behaviour if the range lower bound is greater than the upper bound.
+* Added new `RandomString` routine to the _String Management_ category (issue [28](https://github.com/delphidabbler/code-snippets/issues/28)).
+* Added results of compiling every snippet with Delphi 13 (issue [60](https://github.com/delphidabbler/code-snippets/issues/60)).
+* Fixed bug that was preventing the `Softmax` routine in the _Mathematics_ category from compiling due to a missing unit declaration (issue [61](https://github.com/delphidabbler/code-snippets/issues/61)).
+* Changes to unit tests:
+ * Added a new DUnit test project for the _Structures_ category and added it to the _CodeSnippetsTestsXE_ project group. Unit tests for all snippets in the _Structures_ category were created (issue [58](https://github.com/delphidabbler/code-snippets/issues/58)).
+ * Added further unit tests for all snippets in the _Arrays_ category that did not already have them (issue [38](https://github.com/delphidabbler/code-snippets/issues/38)).
+ * Added unit tests for the new `RandomString` routine.
+* Documentation:
+ * Updated `tests/README.md` re the unit test changes in this release and other minor revisions.
+ * Fixed typo in `README.md`.
+
+## v2.2.3 of 2025/04/03
+
+* Added results of compiling with Delphi 12 for all snippets with no pre-existing compile results for that compiler (issue [#27](https://github.com/delphidabbler/code-snippets/issues/27)).
+* Fixed memory leak in the `CountOccurences` function (issue [#54](https://github.com/delphidabbler/code-snippets/issues/54)).
+* Updated `GetGIFSize` function to work around a deprecated warning with Delphi 12 and some earlier compilers because of a call to `SysUtils.StrLComp` which has been moved to the `AnsiStrings` unit (issue [#52](https://github.com/delphidabbler/code-snippets/issues/52)).
+
+## v2.2.2 of 2025/01/19
+
+* New snippets were added to the _Arrays_ and _Mathematics_ categories:
+ * _Arrays_ category:
+ * `Reverse` method of `TArrayUtils` & `ReverseByteArray` function (issue [#37](https://github.com/delphidabbler/code-snippets/issues/37)).
+ * `Max`, `Min` & `MinMax` methods of `TArrayUtils` (issue [#8](https://github.com/delphidabbler/code-snippets/issues/8)).
+ * _Mathematics_ category:
+ * 3 overloaded versions of each of the `ArithmeticMean` & `WeightedArithmeticMean` functions (issue [#30](https://github.com/delphidabbler/code-snippets/issues/30)).
+ * `DigitSumBase`, `DigitCountBase` & `DigitsOf` function (issue [#17](https://github.com/delphidabbler/code-snippets/issues/17)).
+ * `DigitPowerSum` function (issue [#39](https://github.com/delphidabbler/code-snippets/issues/39)).
+ * `IsPalindromic` function (issue [#19](https://github.com/delphidabbler/code-snippets/issues/19)).
+ * `IsNarcissistic` function (issue [#18](https://github.com/delphidabbler/code-snippets/issues/18)).
+ * `LSE` & `Softmax` functions (issue [34](https://github.com/delphidabbler/code-snippets/issues/34)).
+ * 3 overloaded versions of a `Median` function (issue [#41](https://github.com/delphidabbler/code-snippets/issues/41)).
+ * 2 overloaded versions of each of the `MinMaxOfArray`, `RescaleRange`, `NormaliseByWeight` & `RangeOf` functions (issue [#44](https://github.com/delphidabbler/code-snippets/issues/44)).
+ * 3 overloaded versions of each of the `GeometricMean` and `WeightedGeometricMean` functions (issue [#31](https://github.com/delphidabbler/code-snippets/issues/31)).
+ * 3 overloaded versions of each of the `SumOfReciprocals` and `HarmonicMean` functions (issue [#35](https://github.com/delphidabbler/code-snippets/issues/35)).
+ * 3 overloaded versions of a `WeightedHarmonicMean` function (issue [#47](https://github.com/delphidabbler/code-snippets/issues/47)).
+ * `LogarithmicMean` function (issue [#32](https://github.com/delphidabbler/code-snippets/issues/32)).
+ * 3 overloaded versions of the `PowerMean` and `WeightedPowerMean` functions (issue [#33](https://github.com/delphidabbler/code-snippets/issues/33)).
+ * `Mode`, `ModeAlt`, `ModeCount`, `HasMode` & `CountOccurences` functions (issue [#42](https://github.com/delphidabbler/code-snippets/issues/42)).
+ * 2 overloaded versions of a `RMS` function (issue [#49](https://github.com/delphidabbler/code-snippets/issues/49)).
+ * 2 overloaded versions of a `TSS` (total sum of squares) function (issue [#51](https://github.com/delphidabbler/code-snippets/issues/51)).
+* Updates to snippets in the _Mathematics_ category:
+ * Overflow checking was added to the `PowNZN`.
+ * Fixed bug in all overloads of the `SumOfLogs` routine that was causing access violations whenever an exception was to be raised (issue [#46](https://github.com/delphidabbler/code-snippets/issues/46)).
+* Changes to tests:
+ * Added unit tests for all the routines and methods that were added to the _Arrays_ and _Mathematics_ categories in this release.
+ * Added unit test for the pre-existing `ByteArraysEqual` function in the _Arrays_ category.
+ * Modified unit test for `PowNZN` to check for new `EOverflow` exception raised when an overflow condition is detected.
+ * Removed conditional compilation directives from the array unit test unit.
+* Updated `README.md` to note that there are now over 700 snippets in the collection.
+* Updated all copyright dates for 2025.
+
+## v2.2.1 of 2024/12/02 (HOTFIX)
+
+* Fixed invalid and corrupted values in some `AdvancedTest.URL` and `AdvancedTest.Level` keys in `data.ini`, `hex.ini` and `maths.ini`. Fixes issue [#29](https://github.com/delphidabbler/code-snippets/issues/29).
+
+## v2.2.0 of 2024/10/15
+
+* Updated collection specification:
+ * Added snippet properties to enable recording of compilation results with Delphi 10.2 through to Delphi 12. Fixes issue [#26](https://github.com/delphidabbler/code-snippets/issues/26).
+ * Added new `AdvancedTest.Level` and `AdvancedTest.URL` snippet properties to provide additional information for snippets that have received advanced testing. See issues [#13](https://github.com/delphidabbler/code-snippets/issues/13) & [#15](https://github.com/delphidabbler/code-snippets/issues/15).
+* Changes to the collection:
+ * Added 3 new IEEE Pown functions to the _Maths_ category: `PowN`, `PowNZN`, `PowNZZ`. Fixes issue [#20](https://github.com/delphidabbler/code-snippets/issues/20).
+ * Added 7 overloaded version of each of two new summing functions in the _Maths_ category: `ArraySum` & `SumOfLogs`. Fixes issue [#25](https://github.com/delphidabbler/code-snippets/issues/25).
+ * Added `AdvancedTest.Level` values to numerous snippets that have received advanced testing to provide details of the type of testing. See issue [#15](https://github.com/delphidabbler/code-snippets/issues/15).
+ * Added `AdvancedTest.URL`values to to numerous snippets that have received advanced testing to provide links to the test source code. See issue [#13](https://github.com/delphidabbler/code-snippets/issues/13)
+ * Corrected `RFC1123DateGMT` snippet test level from `advanced` to `basic`.
+ * Fixed syntax errors in `maths.ini` & `hex.ini` category files.
+* Changes to tests:
+ * Comments corrected and updated in the test projects for the `drive` and `winsys` categories.
+ * Pascal files in test projects that were generated from the collection had header comments changed to refer to the revised `LICENSE.md`.
+ * Added unit tests for the `PowN`, `PowNZN`, `PowNZZ` routines and the `ArraySum` & `SumOfLogs` overloaded functions the to maths category test project.
+* Restructured source code repository. All files and sub-directories that were in the `csdb` directory were moved up one directory level and `csdb` was deleted. Fixes issue [#14](https://github.com/delphidabbler/code-snippets/issues/14).
+* Updated documentation:
+ * `README.md` in the repo root was heavily edited to include information formerly in `csdb/README.md`, which was deleted.
+ * `tests/README.md` was changed to reflect the changed repo directory structure and footnotes were converted to GitHub style.
+ * `LICENSE.md` was changed to reflect the different copyright details that apply to the files belong to the collection and other files.
+ * Collection documentation updated as follows:
+ * Noted changes to the collection specification made in this releases.
+ * General editing
+ * Revised styling
+ * Added a new section discussing some issues that may be encountered when designing software to that reads the database.
+ * Fixed a CSS error in `docs/main.css`.
+ * Rewrote REML documentation to link to become a brief overview that links to an authoratitive definition of REML in the `delphidabbler/reml` repository. Fixes issue [#24](https://github.com/delphidabbler/code-snippets/issues/24).
+
+## v2.1.2 of 2023/07/15
+
+* Fixed simple errors and oversights in documentation. Fixes issues [#9](https://github.com/delphidabbler/code-snippets/issues/9) & [#10](https://github.com/delphidabbler/code-snippets/issues/10).
+
+> Other than to update the `VERSION` file there were no changes to any snippets or associated meta-data in this release.
+
+## v2.1.1 of 2021/12/29 (HOTFIX)
+
+* Fixed malformed REML tags. Fixes [issue #7](https://github.com/delphidabbler/code-snippets/issues/7).
+
+## v2.1.0 of 2021/12/26
+
+* Deprecated `Desc`, `Comments`, `Credits` & `Credits_URL` keys in Code Snippets Database collection and changed `DescEx` key to be required. Made following changes to `.ini` files as a consequence:
+ * Changed all `Desc` keys to `DescEx` keys and removed all `Desc` keys as a result.
+ * Converted content of all `Comments`, `Credits` & `Credits_URL` keys to `Extra` key values and removed the deprecated keys.
+* Made all `DescEx` and `Extra` values fully REML v4 compliant by ensuring all content is wrapped in ``..`
` tags.
+* Fixed errors in `.ini` files. Fixes [issue #6](https://github.com/delphidabbler/code-snippets/issues/6).
+* Updated a small number of snippet descriptions and extra information.
+* Updated documentation in `collection-format.html` and `reml.html` to reflect the above changes.
+
+## v2.0.1 of 2021/10/12
+
+* Add new unit tests and demo code for _some_ snippets from the database. All such code was added to a new `tests` directory. See `tests/README.md` for details.
+* Fix minor errors in documentation.
+
+> Other than to update the `VERSION` file there were no changes to any snippets or associated meta-data in this release.
+
+## v2.0.0 of 2020/05/02
+
+Initial release of v2 of the collection.
+
+### Changes since last v1 release
+
+* Removed any code that restricted use of the collection to _[DelphiDabbler CodeSnip](https://github.com/delphidabbler/codesnip)_. The collection can now be used by 3rd party applications.
+ * Removed backwards compatibility with _CodeSnip_ v4.15.1 and earlier.
+ * Removed conditionally included code and _CodeSnip_ version dependent code from category .ini files.
+ * Merged multiple versions of category .ini files down into a single file. (These multiple file were used to hide some categories from earlier versions of _CodeSnip_).
+ * Removed duplicated, _CodeSnip_ version dependent, source code files: used a copy of the most recent version and removed version specifiers from the file names.
+* Rationalised and corrected errors in category .ini files:
+ * Condensed two string management categories into one.
+ * Removed `Desc` keys where they duplicated `DescEx` keys.
+ * Removed some duplicate `Credits` and `Comments` keys.
+ * Removed some empty keys.
+ * Fixed or removed some broken web links.
+ * Rephrased some descriptive text.
+* Changed layout of category .ini files and `categories.ini`:
+ * Re-ordered sections of `categories.ini` in alphabetic order.
+ * Removed all explanatory comments: there were inconsistencies.
+ * Added header comments, including copyright and licensing information, to all .ini files.
+* File format changes:
+ * Removed the `StandardFormat` key from the specification of category .ini files.
+ * Added requirements for `LICENSE`, `LICENSE_INFO` and `VERSION` files and added suitable files to the collection.
+ * Changed the required name for the contributors and testers files to `CONTRIBUTORS` and `TESTERS` respectively. Renamed the existing `contrib.txt` and `testers.txt` files accordingly.
+ * Made support for REML v4 an official requirement.
+ * Dropped support for conditional inclusion of code in .ini files.
+* Added documentation:
+ * Of the collection file format.
+ * A read-me file.
+ * This change log.
+* Ensured that all files in the collection use the UTF-8 text file preamble (aka byte order mark).
+* Added a shell script to create releases.
+* Officially adopted the MIT license for source code files.
diff --git a/LICENSE.md b/LICENSE.md
index ba1b023..ddd8170 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -1,6 +1,10 @@
# MIT License
-**Copyright (c) 2020 Peter Johnson (https://en.gravatar.com/delphidabbler)**
+All `.dat` files in the `collection` directory and certain `.pas` files in the `tests` directory that were generated from the collection are copyright © 2005-2025, [Peter Johnson](https://gravatar.com/delphidabbler) and [Contributors](https://github.com/delphidabbler/code-snippets/tree/master/collection/CONTRIBUTORS).
+
+All other files in this project are copyright © 2020-2025, [Peter Johnson](https://gravatar.com/delphidabbler).
+
+----
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
diff --git a/csdb/MakeRelease.sh b/MakeRelease.sh
similarity index 76%
rename from csdb/MakeRelease.sh
rename to MakeRelease.sh
index d42783b..9433301 100644
--- a/csdb/MakeRelease.sh
+++ b/MakeRelease.sh
@@ -5,13 +5,14 @@
#
# Build tool for Windows to package up files ready for release.
#
-# This file is licensed under the MIT license, copyright © 2020-2021 Peter
+# This file is licensed under the MIT license, copyright © 2020-2023 Peter
# Johnson, https://gravatar.com/delphidabbler
#
#
-# Two packages are made, each in a zip file: one containing the collection and
-# the other containing documentation. Both zip files are written to the
-# _release sub-folder in the collection's home directory.
+# Three packages are made, each in a zip file: one containing the
+# collection, another containing documentation and a third containing tests.
+# All zip files are written to the _release sub-folder in the collection's
+# home directory.
#
# Any pre-existing _release sub-folder is cleared before the zip files are
# created.
@@ -19,9 +20,9 @@
# Requirements:
#
# - The release version number must be passed to this script as a command
-# line.
+# line parameter.
#
-# - The zip utility is required to zip up the files.
+# - The zip utility program is required to zip up the files.
#
# --------------------------------------------------------------------------
diff --git a/README.md b/README.md
index a45dc51..c2b8f48 100644
--- a/README.md
+++ b/README.md
@@ -1,29 +1,63 @@
-# Code Snippets Collections
+# DelphiDabbler Code Snippets Collection
-This repository is used to store a collection of reusable code snippets, mainly in Pascal.
+## Overview
-> **NOTE:** Further collections may be added in the future.
+This repository contains a collection of over 700 reusable Pascal code snippets. The majority are simple functions and procedures but there are also some constants and type definitions, including some advanced records with methods.
+
+Snippets are grouped into categories, with each snippet belonging to exactly one category.
+
+All of the snippets have been tested to some extent: some received basic testing while others have been tested more comprehensively. The collection contains details of the level of testing each snippet received.
## Purpose
-The purpose of this repository is to provide collections of snippets for use with the _DelphiDabbler [CodeSnip](https://github.com/delphidabbler/codesnip)_ program.
+The primary purpose of the collection is for use with the _DelphiDabbler [CodeSnip](https://github.com/delphidabbler/codesnip)_ program.
+
+However the intent is that other applications will also be able to use the collection by parsing the meta data provided with it.
+
+## Documentation
+
+The collection data format is [fully documented](https://htmlpreview.github.io/?https://github.com/delphidabbler/code-snippets/blob/master/docs/index.html) in `docs` directory.
+
+## Using the Collection
+
+Anyone is welcome to write applications or web pages that access the snippets in the collection, subject to the terms of the license (see below). You should read the collection's documentation which explains the file formats in detail.
+
+⚠️ Implementers **must not** read the collection data directly from this GitHub repository - that could generate more than the permitted amount of traffic. Instead you must download a release from the _Releases_ tab and either distribute the collection with the application or host it on a web server.
-However the intent is that other applications will also be able to use the collections by parsing the meta data provided with the collections. It is intended that the meta data will be fully documented.
+## Tests
-## Collections
+Unit tests and demonstration projects are available for _some_ of the snippets.
-So far there is just one collection, the _DelphiDabbler Code Snippets Database_. This collection is version 2 of the database. It is designed for use with _CodeSnip_ v4.16 and later.
+Source code for these tests and demonstrations is available in the `tests` directory. There is a sub-directory for each category where such code is available.
-> The collection is not compatible with versions of _CodeSnip_ up to v4.15.1.
+See the `README.md` file in the `tests` directory for full details.
-The collection can be found in the `csdb` directory. The actual collection is contained in the `collection` sub-directory and it is documented in the `docs` sub-directory - see `collection-format.html` for further information.
+## Releases
+
+Releases can be found on the `releases` tab on the GitHub project page.
+
+Each release[^1] comprises three zip files, as follows (replace `X.Y.Z` in the file names with the release version number):
+
+* `csdb-vX.Y.Z-data.zip` - Contains all the data in the collection. Required by applications that access the collection.
+* `csdb-vX.Y.Z-docs.zip` - Contains the documentation developers need to understand the structure of the data.
+* `csdb-vX.Y.Z-tests.zip` - Contains the unit tests and demo code.
## Development
This repo uses the [Git Flow](http://nvie.com/posts/a-successful-git-branching-model/) methodology - i.e. development proceeds on the `develop` branch and `feature` branches off it. Only released content appears on the `master` branch.
-## Licenses
+## History & Changes
+
+This repository contains version 2 of the collection.
+
+Version 1 was designed exclusively for use with _DelphiDabbler [CodeSnip](https://github.com/delphidabbler/codesnip)_ (v4.15.1 and earlier). It was downloaded by the program directly from a web service on DelphiDabbler.com. This version was not developed under Git and is longer available.
+
+Version 2 is designed to be able to be used by other applications in addition to _CodeSnip_ (v4.16.0 or later). This version is **not** backwards compatible with version 1.
+
+The project's change log can be found in `CHANGELOG.md`.
+
+## License
-The license that applies to this project can be found in `LICENSE.md` in the repo's root directory.
+This project is MIT Licensed. See `LICENSE.md` for full details.
-Code snippets in collections may have a different license or licenses. See the documentation of each collection for details.
+[^1]: `csdb-vX.Y.Z-tests.zip` was only available from v2.0.1.
diff --git a/csdb/collection/001.dat b/collection/001.dat
similarity index 100%
rename from csdb/collection/001.dat
rename to collection/001.dat
diff --git a/csdb/collection/002.dat b/collection/002.dat
similarity index 100%
rename from csdb/collection/002.dat
rename to collection/002.dat
diff --git a/csdb/collection/003.dat b/collection/003.dat
similarity index 100%
rename from csdb/collection/003.dat
rename to collection/003.dat
diff --git a/csdb/collection/004.dat b/collection/004.dat
similarity index 100%
rename from csdb/collection/004.dat
rename to collection/004.dat
diff --git a/csdb/collection/005.dat b/collection/005.dat
similarity index 100%
rename from csdb/collection/005.dat
rename to collection/005.dat
diff --git a/csdb/collection/006.dat b/collection/006.dat
similarity index 100%
rename from csdb/collection/006.dat
rename to collection/006.dat
diff --git a/csdb/collection/007.dat b/collection/007.dat
similarity index 100%
rename from csdb/collection/007.dat
rename to collection/007.dat
diff --git a/csdb/collection/008.dat b/collection/008.dat
similarity index 100%
rename from csdb/collection/008.dat
rename to collection/008.dat
diff --git a/csdb/collection/009.dat b/collection/009.dat
similarity index 100%
rename from csdb/collection/009.dat
rename to collection/009.dat
diff --git a/csdb/collection/010.dat b/collection/010.dat
similarity index 100%
rename from csdb/collection/010.dat
rename to collection/010.dat
diff --git a/csdb/collection/011.dat b/collection/011.dat
similarity index 100%
rename from csdb/collection/011.dat
rename to collection/011.dat
diff --git a/csdb/collection/012.dat b/collection/012.dat
similarity index 100%
rename from csdb/collection/012.dat
rename to collection/012.dat
diff --git a/csdb/collection/013.dat b/collection/013.dat
similarity index 100%
rename from csdb/collection/013.dat
rename to collection/013.dat
diff --git a/csdb/collection/014.dat b/collection/014.dat
similarity index 100%
rename from csdb/collection/014.dat
rename to collection/014.dat
diff --git a/csdb/collection/015.dat b/collection/015.dat
similarity index 100%
rename from csdb/collection/015.dat
rename to collection/015.dat
diff --git a/csdb/collection/016.dat b/collection/016.dat
similarity index 100%
rename from csdb/collection/016.dat
rename to collection/016.dat
diff --git a/csdb/collection/017.dat b/collection/017.dat
similarity index 100%
rename from csdb/collection/017.dat
rename to collection/017.dat
diff --git a/csdb/collection/018.dat b/collection/018.dat
similarity index 100%
rename from csdb/collection/018.dat
rename to collection/018.dat
diff --git a/csdb/collection/019.dat b/collection/019.dat
similarity index 100%
rename from csdb/collection/019.dat
rename to collection/019.dat
diff --git a/csdb/collection/020.dat b/collection/020.dat
similarity index 100%
rename from csdb/collection/020.dat
rename to collection/020.dat
diff --git a/csdb/collection/021.dat b/collection/021.dat
similarity index 100%
rename from csdb/collection/021.dat
rename to collection/021.dat
diff --git a/csdb/collection/022.dat b/collection/022.dat
similarity index 100%
rename from csdb/collection/022.dat
rename to collection/022.dat
diff --git a/csdb/collection/023.dat b/collection/023.dat
similarity index 100%
rename from csdb/collection/023.dat
rename to collection/023.dat
diff --git a/csdb/collection/024.dat b/collection/024.dat
similarity index 100%
rename from csdb/collection/024.dat
rename to collection/024.dat
diff --git a/csdb/collection/025.dat b/collection/025.dat
similarity index 100%
rename from csdb/collection/025.dat
rename to collection/025.dat
diff --git a/csdb/collection/026.dat b/collection/026.dat
similarity index 100%
rename from csdb/collection/026.dat
rename to collection/026.dat
diff --git a/csdb/collection/027.dat b/collection/027.dat
similarity index 100%
rename from csdb/collection/027.dat
rename to collection/027.dat
diff --git a/csdb/collection/028.dat b/collection/028.dat
similarity index 100%
rename from csdb/collection/028.dat
rename to collection/028.dat
diff --git a/csdb/collection/029.dat b/collection/029.dat
similarity index 100%
rename from csdb/collection/029.dat
rename to collection/029.dat
diff --git a/csdb/collection/030.dat b/collection/030.dat
similarity index 100%
rename from csdb/collection/030.dat
rename to collection/030.dat
diff --git a/csdb/collection/031.dat b/collection/031.dat
similarity index 100%
rename from csdb/collection/031.dat
rename to collection/031.dat
diff --git a/csdb/collection/032.dat b/collection/032.dat
similarity index 100%
rename from csdb/collection/032.dat
rename to collection/032.dat
diff --git a/csdb/collection/033.dat b/collection/033.dat
similarity index 100%
rename from csdb/collection/033.dat
rename to collection/033.dat
diff --git a/csdb/collection/034.dat b/collection/034.dat
similarity index 100%
rename from csdb/collection/034.dat
rename to collection/034.dat
diff --git a/csdb/collection/035.dat b/collection/035.dat
similarity index 100%
rename from csdb/collection/035.dat
rename to collection/035.dat
diff --git a/csdb/collection/036.dat b/collection/036.dat
similarity index 100%
rename from csdb/collection/036.dat
rename to collection/036.dat
diff --git a/csdb/collection/037.dat b/collection/037.dat
similarity index 100%
rename from csdb/collection/037.dat
rename to collection/037.dat
diff --git a/csdb/collection/038.dat b/collection/038.dat
similarity index 100%
rename from csdb/collection/038.dat
rename to collection/038.dat
diff --git a/csdb/collection/039.dat b/collection/039.dat
similarity index 100%
rename from csdb/collection/039.dat
rename to collection/039.dat
diff --git a/csdb/collection/040.dat b/collection/040.dat
similarity index 100%
rename from csdb/collection/040.dat
rename to collection/040.dat
diff --git a/csdb/collection/041.dat b/collection/041.dat
similarity index 100%
rename from csdb/collection/041.dat
rename to collection/041.dat
diff --git a/csdb/collection/042.dat b/collection/042.dat
similarity index 100%
rename from csdb/collection/042.dat
rename to collection/042.dat
diff --git a/csdb/collection/043.dat b/collection/043.dat
similarity index 100%
rename from csdb/collection/043.dat
rename to collection/043.dat
diff --git a/csdb/collection/044.dat b/collection/044.dat
similarity index 100%
rename from csdb/collection/044.dat
rename to collection/044.dat
diff --git a/csdb/collection/045.dat b/collection/045.dat
similarity index 100%
rename from csdb/collection/045.dat
rename to collection/045.dat
diff --git a/csdb/collection/046.dat b/collection/046.dat
similarity index 100%
rename from csdb/collection/046.dat
rename to collection/046.dat
diff --git a/csdb/collection/047.dat b/collection/047.dat
similarity index 100%
rename from csdb/collection/047.dat
rename to collection/047.dat
diff --git a/csdb/collection/048.dat b/collection/048.dat
similarity index 100%
rename from csdb/collection/048.dat
rename to collection/048.dat
diff --git a/csdb/collection/049.dat b/collection/049.dat
similarity index 100%
rename from csdb/collection/049.dat
rename to collection/049.dat
diff --git a/csdb/collection/050.dat b/collection/050.dat
similarity index 100%
rename from csdb/collection/050.dat
rename to collection/050.dat
diff --git a/csdb/collection/051.dat b/collection/051.dat
similarity index 100%
rename from csdb/collection/051.dat
rename to collection/051.dat
diff --git a/csdb/collection/052.dat b/collection/052.dat
similarity index 100%
rename from csdb/collection/052.dat
rename to collection/052.dat
diff --git a/csdb/collection/053.dat b/collection/053.dat
similarity index 100%
rename from csdb/collection/053.dat
rename to collection/053.dat
diff --git a/csdb/collection/054.dat b/collection/054.dat
similarity index 100%
rename from csdb/collection/054.dat
rename to collection/054.dat
diff --git a/csdb/collection/055.dat b/collection/055.dat
similarity index 100%
rename from csdb/collection/055.dat
rename to collection/055.dat
diff --git a/csdb/collection/056.dat b/collection/056.dat
similarity index 100%
rename from csdb/collection/056.dat
rename to collection/056.dat
diff --git a/csdb/collection/057.dat b/collection/057.dat
similarity index 100%
rename from csdb/collection/057.dat
rename to collection/057.dat
diff --git a/csdb/collection/058.dat b/collection/058.dat
similarity index 100%
rename from csdb/collection/058.dat
rename to collection/058.dat
diff --git a/csdb/collection/059.dat b/collection/059.dat
similarity index 100%
rename from csdb/collection/059.dat
rename to collection/059.dat
diff --git a/csdb/collection/060.dat b/collection/060.dat
similarity index 100%
rename from csdb/collection/060.dat
rename to collection/060.dat
diff --git a/csdb/collection/061.dat b/collection/061.dat
similarity index 100%
rename from csdb/collection/061.dat
rename to collection/061.dat
diff --git a/csdb/collection/062.dat b/collection/062.dat
similarity index 100%
rename from csdb/collection/062.dat
rename to collection/062.dat
diff --git a/csdb/collection/063.dat b/collection/063.dat
similarity index 100%
rename from csdb/collection/063.dat
rename to collection/063.dat
diff --git a/csdb/collection/064.dat b/collection/064.dat
similarity index 100%
rename from csdb/collection/064.dat
rename to collection/064.dat
diff --git a/csdb/collection/065.dat b/collection/065.dat
similarity index 100%
rename from csdb/collection/065.dat
rename to collection/065.dat
diff --git a/csdb/collection/066.dat b/collection/066.dat
similarity index 100%
rename from csdb/collection/066.dat
rename to collection/066.dat
diff --git a/csdb/collection/067.dat b/collection/067.dat
similarity index 100%
rename from csdb/collection/067.dat
rename to collection/067.dat
diff --git a/csdb/collection/068.dat b/collection/068.dat
similarity index 100%
rename from csdb/collection/068.dat
rename to collection/068.dat
diff --git a/csdb/collection/069.dat b/collection/069.dat
similarity index 100%
rename from csdb/collection/069.dat
rename to collection/069.dat
diff --git a/csdb/collection/070.dat b/collection/070.dat
similarity index 100%
rename from csdb/collection/070.dat
rename to collection/070.dat
diff --git a/csdb/collection/071.dat b/collection/071.dat
similarity index 100%
rename from csdb/collection/071.dat
rename to collection/071.dat
diff --git a/csdb/collection/072.dat b/collection/072.dat
similarity index 100%
rename from csdb/collection/072.dat
rename to collection/072.dat
diff --git a/csdb/collection/073.dat b/collection/073.dat
similarity index 100%
rename from csdb/collection/073.dat
rename to collection/073.dat
diff --git a/csdb/collection/074.dat b/collection/074.dat
similarity index 100%
rename from csdb/collection/074.dat
rename to collection/074.dat
diff --git a/csdb/collection/075.dat b/collection/075.dat
similarity index 100%
rename from csdb/collection/075.dat
rename to collection/075.dat
diff --git a/csdb/collection/076.dat b/collection/076.dat
similarity index 100%
rename from csdb/collection/076.dat
rename to collection/076.dat
diff --git a/csdb/collection/077.dat b/collection/077.dat
similarity index 100%
rename from csdb/collection/077.dat
rename to collection/077.dat
diff --git a/csdb/collection/078.dat b/collection/078.dat
similarity index 100%
rename from csdb/collection/078.dat
rename to collection/078.dat
diff --git a/csdb/collection/079.dat b/collection/079.dat
similarity index 100%
rename from csdb/collection/079.dat
rename to collection/079.dat
diff --git a/csdb/collection/080.dat b/collection/080.dat
similarity index 100%
rename from csdb/collection/080.dat
rename to collection/080.dat
diff --git a/csdb/collection/081.dat b/collection/081.dat
similarity index 100%
rename from csdb/collection/081.dat
rename to collection/081.dat
diff --git a/csdb/collection/082.dat b/collection/082.dat
similarity index 100%
rename from csdb/collection/082.dat
rename to collection/082.dat
diff --git a/csdb/collection/083.dat b/collection/083.dat
similarity index 100%
rename from csdb/collection/083.dat
rename to collection/083.dat
diff --git a/csdb/collection/084.dat b/collection/084.dat
similarity index 100%
rename from csdb/collection/084.dat
rename to collection/084.dat
diff --git a/csdb/collection/085.dat b/collection/085.dat
similarity index 100%
rename from csdb/collection/085.dat
rename to collection/085.dat
diff --git a/csdb/collection/086.dat b/collection/086.dat
similarity index 100%
rename from csdb/collection/086.dat
rename to collection/086.dat
diff --git a/csdb/collection/087.dat b/collection/087.dat
similarity index 100%
rename from csdb/collection/087.dat
rename to collection/087.dat
diff --git a/csdb/collection/088.dat b/collection/088.dat
similarity index 100%
rename from csdb/collection/088.dat
rename to collection/088.dat
diff --git a/csdb/collection/089.dat b/collection/089.dat
similarity index 100%
rename from csdb/collection/089.dat
rename to collection/089.dat
diff --git a/csdb/collection/090.dat b/collection/090.dat
similarity index 100%
rename from csdb/collection/090.dat
rename to collection/090.dat
diff --git a/csdb/collection/091.dat b/collection/091.dat
similarity index 100%
rename from csdb/collection/091.dat
rename to collection/091.dat
diff --git a/csdb/collection/092.dat b/collection/092.dat
similarity index 100%
rename from csdb/collection/092.dat
rename to collection/092.dat
diff --git a/csdb/collection/093.dat b/collection/093.dat
similarity index 100%
rename from csdb/collection/093.dat
rename to collection/093.dat
diff --git a/csdb/collection/094.dat b/collection/094.dat
similarity index 100%
rename from csdb/collection/094.dat
rename to collection/094.dat
diff --git a/csdb/collection/095.dat b/collection/095.dat
similarity index 100%
rename from csdb/collection/095.dat
rename to collection/095.dat
diff --git a/csdb/collection/096.dat b/collection/096.dat
similarity index 100%
rename from csdb/collection/096.dat
rename to collection/096.dat
diff --git a/csdb/collection/097.dat b/collection/097.dat
similarity index 100%
rename from csdb/collection/097.dat
rename to collection/097.dat
diff --git a/csdb/collection/098.dat b/collection/098.dat
similarity index 100%
rename from csdb/collection/098.dat
rename to collection/098.dat
diff --git a/csdb/collection/099.dat b/collection/099.dat
similarity index 100%
rename from csdb/collection/099.dat
rename to collection/099.dat
diff --git a/csdb/collection/100.dat b/collection/100.dat
similarity index 100%
rename from csdb/collection/100.dat
rename to collection/100.dat
diff --git a/csdb/collection/101.dat b/collection/101.dat
similarity index 100%
rename from csdb/collection/101.dat
rename to collection/101.dat
diff --git a/csdb/collection/102.dat b/collection/102.dat
similarity index 100%
rename from csdb/collection/102.dat
rename to collection/102.dat
diff --git a/csdb/collection/103.dat b/collection/103.dat
similarity index 100%
rename from csdb/collection/103.dat
rename to collection/103.dat
diff --git a/csdb/collection/104.dat b/collection/104.dat
similarity index 100%
rename from csdb/collection/104.dat
rename to collection/104.dat
diff --git a/csdb/collection/105.dat b/collection/105.dat
similarity index 100%
rename from csdb/collection/105.dat
rename to collection/105.dat
diff --git a/csdb/collection/106.dat b/collection/106.dat
similarity index 100%
rename from csdb/collection/106.dat
rename to collection/106.dat
diff --git a/csdb/collection/107.dat b/collection/107.dat
similarity index 100%
rename from csdb/collection/107.dat
rename to collection/107.dat
diff --git a/csdb/collection/108.dat b/collection/108.dat
similarity index 100%
rename from csdb/collection/108.dat
rename to collection/108.dat
diff --git a/csdb/collection/109.dat b/collection/109.dat
similarity index 100%
rename from csdb/collection/109.dat
rename to collection/109.dat
diff --git a/csdb/collection/110.dat b/collection/110.dat
similarity index 100%
rename from csdb/collection/110.dat
rename to collection/110.dat
diff --git a/csdb/collection/111.dat b/collection/111.dat
similarity index 100%
rename from csdb/collection/111.dat
rename to collection/111.dat
diff --git a/csdb/collection/112.dat b/collection/112.dat
similarity index 100%
rename from csdb/collection/112.dat
rename to collection/112.dat
diff --git a/csdb/collection/113.dat b/collection/113.dat
similarity index 100%
rename from csdb/collection/113.dat
rename to collection/113.dat
diff --git a/csdb/collection/114.dat b/collection/114.dat
similarity index 100%
rename from csdb/collection/114.dat
rename to collection/114.dat
diff --git a/csdb/collection/115.dat b/collection/115.dat
similarity index 100%
rename from csdb/collection/115.dat
rename to collection/115.dat
diff --git a/csdb/collection/116.dat b/collection/116.dat
similarity index 100%
rename from csdb/collection/116.dat
rename to collection/116.dat
diff --git a/csdb/collection/117.dat b/collection/117.dat
similarity index 100%
rename from csdb/collection/117.dat
rename to collection/117.dat
diff --git a/csdb/collection/118.dat b/collection/118.dat
similarity index 100%
rename from csdb/collection/118.dat
rename to collection/118.dat
diff --git a/csdb/collection/119.dat b/collection/119.dat
similarity index 100%
rename from csdb/collection/119.dat
rename to collection/119.dat
diff --git a/csdb/collection/120.dat b/collection/120.dat
similarity index 100%
rename from csdb/collection/120.dat
rename to collection/120.dat
diff --git a/csdb/collection/121.dat b/collection/121.dat
similarity index 100%
rename from csdb/collection/121.dat
rename to collection/121.dat
diff --git a/csdb/collection/122.dat b/collection/122.dat
similarity index 100%
rename from csdb/collection/122.dat
rename to collection/122.dat
diff --git a/csdb/collection/123.dat b/collection/123.dat
similarity index 100%
rename from csdb/collection/123.dat
rename to collection/123.dat
diff --git a/csdb/collection/124.dat b/collection/124.dat
similarity index 100%
rename from csdb/collection/124.dat
rename to collection/124.dat
diff --git a/csdb/collection/125.dat b/collection/125.dat
similarity index 100%
rename from csdb/collection/125.dat
rename to collection/125.dat
diff --git a/csdb/collection/126.dat b/collection/126.dat
similarity index 100%
rename from csdb/collection/126.dat
rename to collection/126.dat
diff --git a/csdb/collection/127.dat b/collection/127.dat
similarity index 100%
rename from csdb/collection/127.dat
rename to collection/127.dat
diff --git a/csdb/collection/128.dat b/collection/128.dat
similarity index 100%
rename from csdb/collection/128.dat
rename to collection/128.dat
diff --git a/csdb/collection/129.dat b/collection/129.dat
similarity index 100%
rename from csdb/collection/129.dat
rename to collection/129.dat
diff --git a/csdb/collection/130.dat b/collection/130.dat
similarity index 100%
rename from csdb/collection/130.dat
rename to collection/130.dat
diff --git a/csdb/collection/131.dat b/collection/131.dat
similarity index 100%
rename from csdb/collection/131.dat
rename to collection/131.dat
diff --git a/csdb/collection/132.dat b/collection/132.dat
similarity index 100%
rename from csdb/collection/132.dat
rename to collection/132.dat
diff --git a/csdb/collection/133.dat b/collection/133.dat
similarity index 100%
rename from csdb/collection/133.dat
rename to collection/133.dat
diff --git a/csdb/collection/134.dat b/collection/134.dat
similarity index 100%
rename from csdb/collection/134.dat
rename to collection/134.dat
diff --git a/csdb/collection/135.dat b/collection/135.dat
similarity index 100%
rename from csdb/collection/135.dat
rename to collection/135.dat
diff --git a/csdb/collection/136.dat b/collection/136.dat
similarity index 100%
rename from csdb/collection/136.dat
rename to collection/136.dat
diff --git a/csdb/collection/137.dat b/collection/137.dat
similarity index 100%
rename from csdb/collection/137.dat
rename to collection/137.dat
diff --git a/csdb/collection/138.dat b/collection/138.dat
similarity index 100%
rename from csdb/collection/138.dat
rename to collection/138.dat
diff --git a/csdb/collection/139.dat b/collection/139.dat
similarity index 100%
rename from csdb/collection/139.dat
rename to collection/139.dat
diff --git a/csdb/collection/140.dat b/collection/140.dat
similarity index 100%
rename from csdb/collection/140.dat
rename to collection/140.dat
diff --git a/csdb/collection/141.dat b/collection/141.dat
similarity index 100%
rename from csdb/collection/141.dat
rename to collection/141.dat
diff --git a/csdb/collection/142.dat b/collection/142.dat
similarity index 100%
rename from csdb/collection/142.dat
rename to collection/142.dat
diff --git a/csdb/collection/143.dat b/collection/143.dat
similarity index 100%
rename from csdb/collection/143.dat
rename to collection/143.dat
diff --git a/csdb/collection/144.dat b/collection/144.dat
similarity index 100%
rename from csdb/collection/144.dat
rename to collection/144.dat
diff --git a/csdb/collection/145.dat b/collection/145.dat
similarity index 100%
rename from csdb/collection/145.dat
rename to collection/145.dat
diff --git a/csdb/collection/146.dat b/collection/146.dat
similarity index 100%
rename from csdb/collection/146.dat
rename to collection/146.dat
diff --git a/csdb/collection/147.dat b/collection/147.dat
similarity index 100%
rename from csdb/collection/147.dat
rename to collection/147.dat
diff --git a/csdb/collection/148.dat b/collection/148.dat
similarity index 100%
rename from csdb/collection/148.dat
rename to collection/148.dat
diff --git a/csdb/collection/149.dat b/collection/149.dat
similarity index 100%
rename from csdb/collection/149.dat
rename to collection/149.dat
diff --git a/csdb/collection/150.dat b/collection/150.dat
similarity index 100%
rename from csdb/collection/150.dat
rename to collection/150.dat
diff --git a/csdb/collection/151.dat b/collection/151.dat
similarity index 100%
rename from csdb/collection/151.dat
rename to collection/151.dat
diff --git a/csdb/collection/152.dat b/collection/152.dat
similarity index 100%
rename from csdb/collection/152.dat
rename to collection/152.dat
diff --git a/csdb/collection/153.dat b/collection/153.dat
similarity index 100%
rename from csdb/collection/153.dat
rename to collection/153.dat
diff --git a/csdb/collection/154.dat b/collection/154.dat
similarity index 100%
rename from csdb/collection/154.dat
rename to collection/154.dat
diff --git a/csdb/collection/155.dat b/collection/155.dat
similarity index 100%
rename from csdb/collection/155.dat
rename to collection/155.dat
diff --git a/csdb/collection/156.dat b/collection/156.dat
similarity index 100%
rename from csdb/collection/156.dat
rename to collection/156.dat
diff --git a/csdb/collection/157.dat b/collection/157.dat
similarity index 100%
rename from csdb/collection/157.dat
rename to collection/157.dat
diff --git a/csdb/collection/158.dat b/collection/158.dat
similarity index 100%
rename from csdb/collection/158.dat
rename to collection/158.dat
diff --git a/csdb/collection/159.dat b/collection/159.dat
similarity index 100%
rename from csdb/collection/159.dat
rename to collection/159.dat
diff --git a/csdb/collection/160.dat b/collection/160.dat
similarity index 100%
rename from csdb/collection/160.dat
rename to collection/160.dat
diff --git a/csdb/collection/161.dat b/collection/161.dat
similarity index 100%
rename from csdb/collection/161.dat
rename to collection/161.dat
diff --git a/csdb/collection/162.dat b/collection/162.dat
similarity index 100%
rename from csdb/collection/162.dat
rename to collection/162.dat
diff --git a/csdb/collection/163.dat b/collection/163.dat
similarity index 100%
rename from csdb/collection/163.dat
rename to collection/163.dat
diff --git a/csdb/collection/164.dat b/collection/164.dat
similarity index 100%
rename from csdb/collection/164.dat
rename to collection/164.dat
diff --git a/csdb/collection/165.dat b/collection/165.dat
similarity index 100%
rename from csdb/collection/165.dat
rename to collection/165.dat
diff --git a/csdb/collection/166.dat b/collection/166.dat
similarity index 100%
rename from csdb/collection/166.dat
rename to collection/166.dat
diff --git a/csdb/collection/167.dat b/collection/167.dat
similarity index 100%
rename from csdb/collection/167.dat
rename to collection/167.dat
diff --git a/csdb/collection/168.dat b/collection/168.dat
similarity index 100%
rename from csdb/collection/168.dat
rename to collection/168.dat
diff --git a/csdb/collection/169.dat b/collection/169.dat
similarity index 100%
rename from csdb/collection/169.dat
rename to collection/169.dat
diff --git a/csdb/collection/170.dat b/collection/170.dat
similarity index 100%
rename from csdb/collection/170.dat
rename to collection/170.dat
diff --git a/csdb/collection/171.dat b/collection/171.dat
similarity index 100%
rename from csdb/collection/171.dat
rename to collection/171.dat
diff --git a/csdb/collection/172.dat b/collection/172.dat
similarity index 100%
rename from csdb/collection/172.dat
rename to collection/172.dat
diff --git a/csdb/collection/173.dat b/collection/173.dat
similarity index 100%
rename from csdb/collection/173.dat
rename to collection/173.dat
diff --git a/csdb/collection/174.dat b/collection/174.dat
similarity index 100%
rename from csdb/collection/174.dat
rename to collection/174.dat
diff --git a/csdb/collection/175.dat b/collection/175.dat
similarity index 100%
rename from csdb/collection/175.dat
rename to collection/175.dat
diff --git a/csdb/collection/176.dat b/collection/176.dat
similarity index 100%
rename from csdb/collection/176.dat
rename to collection/176.dat
diff --git a/csdb/collection/177.dat b/collection/177.dat
similarity index 100%
rename from csdb/collection/177.dat
rename to collection/177.dat
diff --git a/csdb/collection/178.dat b/collection/178.dat
similarity index 100%
rename from csdb/collection/178.dat
rename to collection/178.dat
diff --git a/csdb/collection/179.dat b/collection/179.dat
similarity index 100%
rename from csdb/collection/179.dat
rename to collection/179.dat
diff --git a/csdb/collection/180.dat b/collection/180.dat
similarity index 100%
rename from csdb/collection/180.dat
rename to collection/180.dat
diff --git a/csdb/collection/181.dat b/collection/181.dat
similarity index 100%
rename from csdb/collection/181.dat
rename to collection/181.dat
diff --git a/csdb/collection/182.dat b/collection/182.dat
similarity index 100%
rename from csdb/collection/182.dat
rename to collection/182.dat
diff --git a/csdb/collection/183.dat b/collection/183.dat
similarity index 100%
rename from csdb/collection/183.dat
rename to collection/183.dat
diff --git a/csdb/collection/184.dat b/collection/184.dat
similarity index 100%
rename from csdb/collection/184.dat
rename to collection/184.dat
diff --git a/csdb/collection/185.dat b/collection/185.dat
similarity index 100%
rename from csdb/collection/185.dat
rename to collection/185.dat
diff --git a/csdb/collection/186.dat b/collection/186.dat
similarity index 100%
rename from csdb/collection/186.dat
rename to collection/186.dat
diff --git a/csdb/collection/187.dat b/collection/187.dat
similarity index 100%
rename from csdb/collection/187.dat
rename to collection/187.dat
diff --git a/csdb/collection/188.dat b/collection/188.dat
similarity index 100%
rename from csdb/collection/188.dat
rename to collection/188.dat
diff --git a/csdb/collection/189.dat b/collection/189.dat
similarity index 100%
rename from csdb/collection/189.dat
rename to collection/189.dat
diff --git a/csdb/collection/190.dat b/collection/190.dat
similarity index 100%
rename from csdb/collection/190.dat
rename to collection/190.dat
diff --git a/csdb/collection/191.dat b/collection/191.dat
similarity index 100%
rename from csdb/collection/191.dat
rename to collection/191.dat
diff --git a/csdb/collection/192.dat b/collection/192.dat
similarity index 100%
rename from csdb/collection/192.dat
rename to collection/192.dat
diff --git a/csdb/collection/193.dat b/collection/193.dat
similarity index 100%
rename from csdb/collection/193.dat
rename to collection/193.dat
diff --git a/csdb/collection/194.dat b/collection/194.dat
similarity index 100%
rename from csdb/collection/194.dat
rename to collection/194.dat
diff --git a/csdb/collection/195.dat b/collection/195.dat
similarity index 100%
rename from csdb/collection/195.dat
rename to collection/195.dat
diff --git a/csdb/collection/196.dat b/collection/196.dat
similarity index 100%
rename from csdb/collection/196.dat
rename to collection/196.dat
diff --git a/csdb/collection/197.dat b/collection/197.dat
similarity index 100%
rename from csdb/collection/197.dat
rename to collection/197.dat
diff --git a/csdb/collection/198.dat b/collection/198.dat
similarity index 100%
rename from csdb/collection/198.dat
rename to collection/198.dat
diff --git a/csdb/collection/199.dat b/collection/199.dat
similarity index 100%
rename from csdb/collection/199.dat
rename to collection/199.dat
diff --git a/csdb/collection/200.dat b/collection/200.dat
similarity index 100%
rename from csdb/collection/200.dat
rename to collection/200.dat
diff --git a/csdb/collection/201.dat b/collection/201.dat
similarity index 100%
rename from csdb/collection/201.dat
rename to collection/201.dat
diff --git a/csdb/collection/202.dat b/collection/202.dat
similarity index 100%
rename from csdb/collection/202.dat
rename to collection/202.dat
diff --git a/csdb/collection/203.dat b/collection/203.dat
similarity index 100%
rename from csdb/collection/203.dat
rename to collection/203.dat
diff --git a/csdb/collection/204.dat b/collection/204.dat
similarity index 100%
rename from csdb/collection/204.dat
rename to collection/204.dat
diff --git a/csdb/collection/205.dat b/collection/205.dat
similarity index 100%
rename from csdb/collection/205.dat
rename to collection/205.dat
diff --git a/csdb/collection/206.dat b/collection/206.dat
similarity index 100%
rename from csdb/collection/206.dat
rename to collection/206.dat
diff --git a/csdb/collection/207.dat b/collection/207.dat
similarity index 100%
rename from csdb/collection/207.dat
rename to collection/207.dat
diff --git a/csdb/collection/208.dat b/collection/208.dat
similarity index 100%
rename from csdb/collection/208.dat
rename to collection/208.dat
diff --git a/csdb/collection/209.dat b/collection/209.dat
similarity index 100%
rename from csdb/collection/209.dat
rename to collection/209.dat
diff --git a/csdb/collection/210.dat b/collection/210.dat
similarity index 100%
rename from csdb/collection/210.dat
rename to collection/210.dat
diff --git a/csdb/collection/211.dat b/collection/211.dat
similarity index 100%
rename from csdb/collection/211.dat
rename to collection/211.dat
diff --git a/csdb/collection/212.dat b/collection/212.dat
similarity index 100%
rename from csdb/collection/212.dat
rename to collection/212.dat
diff --git a/csdb/collection/213.dat b/collection/213.dat
similarity index 100%
rename from csdb/collection/213.dat
rename to collection/213.dat
diff --git a/csdb/collection/214.dat b/collection/214.dat
similarity index 100%
rename from csdb/collection/214.dat
rename to collection/214.dat
diff --git a/csdb/collection/215.dat b/collection/215.dat
similarity index 100%
rename from csdb/collection/215.dat
rename to collection/215.dat
diff --git a/csdb/collection/216.dat b/collection/216.dat
similarity index 100%
rename from csdb/collection/216.dat
rename to collection/216.dat
diff --git a/csdb/collection/217.dat b/collection/217.dat
similarity index 100%
rename from csdb/collection/217.dat
rename to collection/217.dat
diff --git a/csdb/collection/218.dat b/collection/218.dat
similarity index 100%
rename from csdb/collection/218.dat
rename to collection/218.dat
diff --git a/csdb/collection/219.dat b/collection/219.dat
similarity index 100%
rename from csdb/collection/219.dat
rename to collection/219.dat
diff --git a/csdb/collection/220.dat b/collection/220.dat
similarity index 100%
rename from csdb/collection/220.dat
rename to collection/220.dat
diff --git a/csdb/collection/221.dat b/collection/221.dat
similarity index 100%
rename from csdb/collection/221.dat
rename to collection/221.dat
diff --git a/csdb/collection/222.dat b/collection/222.dat
similarity index 93%
rename from csdb/collection/222.dat
rename to collection/222.dat
index a3096df..4c98892 100644
--- a/csdb/collection/222.dat
+++ b/collection/222.dat
@@ -15,8 +15,8 @@ type
Flags: Byte; // flags and local colour table size
end;
const
- cSignature: PAnsiChar = 'GIF'; // gif image signature
- cImageSep = $2C; // image separator byte
+ cSignature = 'GIF'; // gif image signature
+ cImageSep = $2C; // image separator byte
var
FS: Classes.TFileStream; // stream onto gif file
Header: TGIFHeader; // gif header record
@@ -37,7 +37,7 @@ begin
// Check signature
BytesRead := FS.Read(Header, SizeOf(Header));
if (BytesRead <> SizeOf(TGIFHeader)) or
- (SysUtils.StrLComp(cSignature, Header.Sig, 3) <> 0) then
+ (Copy(Header.sig, 1, 3) <> cSignature) then
// Invalid file format
Exit;
// Skip colour map, if there is one
diff --git a/csdb/collection/223.dat b/collection/223.dat
similarity index 100%
rename from csdb/collection/223.dat
rename to collection/223.dat
diff --git a/csdb/collection/224.dat b/collection/224.dat
similarity index 100%
rename from csdb/collection/224.dat
rename to collection/224.dat
diff --git a/csdb/collection/225.dat b/collection/225.dat
similarity index 100%
rename from csdb/collection/225.dat
rename to collection/225.dat
diff --git a/csdb/collection/226.dat b/collection/226.dat
similarity index 100%
rename from csdb/collection/226.dat
rename to collection/226.dat
diff --git a/csdb/collection/227.dat b/collection/227.dat
similarity index 100%
rename from csdb/collection/227.dat
rename to collection/227.dat
diff --git a/csdb/collection/228.dat b/collection/228.dat
similarity index 100%
rename from csdb/collection/228.dat
rename to collection/228.dat
diff --git a/csdb/collection/229.dat b/collection/229.dat
similarity index 100%
rename from csdb/collection/229.dat
rename to collection/229.dat
diff --git a/csdb/collection/230.dat b/collection/230.dat
similarity index 100%
rename from csdb/collection/230.dat
rename to collection/230.dat
diff --git a/csdb/collection/231.dat b/collection/231.dat
similarity index 100%
rename from csdb/collection/231.dat
rename to collection/231.dat
diff --git a/csdb/collection/232.dat b/collection/232.dat
similarity index 100%
rename from csdb/collection/232.dat
rename to collection/232.dat
diff --git a/csdb/collection/233.dat b/collection/233.dat
similarity index 100%
rename from csdb/collection/233.dat
rename to collection/233.dat
diff --git a/csdb/collection/234.dat b/collection/234.dat
similarity index 100%
rename from csdb/collection/234.dat
rename to collection/234.dat
diff --git a/csdb/collection/235.dat b/collection/235.dat
similarity index 100%
rename from csdb/collection/235.dat
rename to collection/235.dat
diff --git a/csdb/collection/236.dat b/collection/236.dat
similarity index 100%
rename from csdb/collection/236.dat
rename to collection/236.dat
diff --git a/csdb/collection/237.dat b/collection/237.dat
similarity index 100%
rename from csdb/collection/237.dat
rename to collection/237.dat
diff --git a/csdb/collection/238.dat b/collection/238.dat
similarity index 100%
rename from csdb/collection/238.dat
rename to collection/238.dat
diff --git a/csdb/collection/239.dat b/collection/239.dat
similarity index 100%
rename from csdb/collection/239.dat
rename to collection/239.dat
diff --git a/csdb/collection/240.dat b/collection/240.dat
similarity index 100%
rename from csdb/collection/240.dat
rename to collection/240.dat
diff --git a/csdb/collection/241.dat b/collection/241.dat
similarity index 100%
rename from csdb/collection/241.dat
rename to collection/241.dat
diff --git a/csdb/collection/242.dat b/collection/242.dat
similarity index 100%
rename from csdb/collection/242.dat
rename to collection/242.dat
diff --git a/csdb/collection/243.dat b/collection/243.dat
similarity index 100%
rename from csdb/collection/243.dat
rename to collection/243.dat
diff --git a/csdb/collection/244.dat b/collection/244.dat
similarity index 100%
rename from csdb/collection/244.dat
rename to collection/244.dat
diff --git a/csdb/collection/245.dat b/collection/245.dat
similarity index 100%
rename from csdb/collection/245.dat
rename to collection/245.dat
diff --git a/csdb/collection/246.dat b/collection/246.dat
similarity index 100%
rename from csdb/collection/246.dat
rename to collection/246.dat
diff --git a/csdb/collection/247.dat b/collection/247.dat
similarity index 100%
rename from csdb/collection/247.dat
rename to collection/247.dat
diff --git a/csdb/collection/248.dat b/collection/248.dat
similarity index 100%
rename from csdb/collection/248.dat
rename to collection/248.dat
diff --git a/csdb/collection/249.dat b/collection/249.dat
similarity index 100%
rename from csdb/collection/249.dat
rename to collection/249.dat
diff --git a/csdb/collection/250.dat b/collection/250.dat
similarity index 100%
rename from csdb/collection/250.dat
rename to collection/250.dat
diff --git a/csdb/collection/251.dat b/collection/251.dat
similarity index 100%
rename from csdb/collection/251.dat
rename to collection/251.dat
diff --git a/csdb/collection/252.dat b/collection/252.dat
similarity index 100%
rename from csdb/collection/252.dat
rename to collection/252.dat
diff --git a/csdb/collection/253.dat b/collection/253.dat
similarity index 100%
rename from csdb/collection/253.dat
rename to collection/253.dat
diff --git a/csdb/collection/254.dat b/collection/254.dat
similarity index 100%
rename from csdb/collection/254.dat
rename to collection/254.dat
diff --git a/csdb/collection/255.dat b/collection/255.dat
similarity index 100%
rename from csdb/collection/255.dat
rename to collection/255.dat
diff --git a/csdb/collection/256.dat b/collection/256.dat
similarity index 100%
rename from csdb/collection/256.dat
rename to collection/256.dat
diff --git a/csdb/collection/257.dat b/collection/257.dat
similarity index 100%
rename from csdb/collection/257.dat
rename to collection/257.dat
diff --git a/csdb/collection/258.dat b/collection/258.dat
similarity index 100%
rename from csdb/collection/258.dat
rename to collection/258.dat
diff --git a/csdb/collection/259.dat b/collection/259.dat
similarity index 100%
rename from csdb/collection/259.dat
rename to collection/259.dat
diff --git a/csdb/collection/260.dat b/collection/260.dat
similarity index 100%
rename from csdb/collection/260.dat
rename to collection/260.dat
diff --git a/csdb/collection/261.dat b/collection/261.dat
similarity index 100%
rename from csdb/collection/261.dat
rename to collection/261.dat
diff --git a/csdb/collection/262.dat b/collection/262.dat
similarity index 100%
rename from csdb/collection/262.dat
rename to collection/262.dat
diff --git a/csdb/collection/263.dat b/collection/263.dat
similarity index 100%
rename from csdb/collection/263.dat
rename to collection/263.dat
diff --git a/csdb/collection/264.dat b/collection/264.dat
similarity index 100%
rename from csdb/collection/264.dat
rename to collection/264.dat
diff --git a/csdb/collection/265.dat b/collection/265.dat
similarity index 100%
rename from csdb/collection/265.dat
rename to collection/265.dat
diff --git a/csdb/collection/266.dat b/collection/266.dat
similarity index 100%
rename from csdb/collection/266.dat
rename to collection/266.dat
diff --git a/csdb/collection/267.dat b/collection/267.dat
similarity index 100%
rename from csdb/collection/267.dat
rename to collection/267.dat
diff --git a/csdb/collection/268.dat b/collection/268.dat
similarity index 100%
rename from csdb/collection/268.dat
rename to collection/268.dat
diff --git a/csdb/collection/269.dat b/collection/269.dat
similarity index 100%
rename from csdb/collection/269.dat
rename to collection/269.dat
diff --git a/csdb/collection/270.dat b/collection/270.dat
similarity index 100%
rename from csdb/collection/270.dat
rename to collection/270.dat
diff --git a/csdb/collection/271.dat b/collection/271.dat
similarity index 100%
rename from csdb/collection/271.dat
rename to collection/271.dat
diff --git a/csdb/collection/272.dat b/collection/272.dat
similarity index 100%
rename from csdb/collection/272.dat
rename to collection/272.dat
diff --git a/csdb/collection/273.dat b/collection/273.dat
similarity index 100%
rename from csdb/collection/273.dat
rename to collection/273.dat
diff --git a/csdb/collection/274.dat b/collection/274.dat
similarity index 100%
rename from csdb/collection/274.dat
rename to collection/274.dat
diff --git a/csdb/collection/275.dat b/collection/275.dat
similarity index 100%
rename from csdb/collection/275.dat
rename to collection/275.dat
diff --git a/csdb/collection/276.dat b/collection/276.dat
similarity index 100%
rename from csdb/collection/276.dat
rename to collection/276.dat
diff --git a/csdb/collection/277.dat b/collection/277.dat
similarity index 100%
rename from csdb/collection/277.dat
rename to collection/277.dat
diff --git a/csdb/collection/278.dat b/collection/278.dat
similarity index 100%
rename from csdb/collection/278.dat
rename to collection/278.dat
diff --git a/csdb/collection/279.dat b/collection/279.dat
similarity index 100%
rename from csdb/collection/279.dat
rename to collection/279.dat
diff --git a/csdb/collection/280.dat b/collection/280.dat
similarity index 100%
rename from csdb/collection/280.dat
rename to collection/280.dat
diff --git a/csdb/collection/281.dat b/collection/281.dat
similarity index 100%
rename from csdb/collection/281.dat
rename to collection/281.dat
diff --git a/csdb/collection/282.dat b/collection/282.dat
similarity index 100%
rename from csdb/collection/282.dat
rename to collection/282.dat
diff --git a/csdb/collection/283.dat b/collection/283.dat
similarity index 100%
rename from csdb/collection/283.dat
rename to collection/283.dat
diff --git a/csdb/collection/284.dat b/collection/284.dat
similarity index 100%
rename from csdb/collection/284.dat
rename to collection/284.dat
diff --git a/csdb/collection/285.dat b/collection/285.dat
similarity index 100%
rename from csdb/collection/285.dat
rename to collection/285.dat
diff --git a/csdb/collection/286.dat b/collection/286.dat
similarity index 100%
rename from csdb/collection/286.dat
rename to collection/286.dat
diff --git a/csdb/collection/287.dat b/collection/287.dat
similarity index 100%
rename from csdb/collection/287.dat
rename to collection/287.dat
diff --git a/csdb/collection/288.dat b/collection/288.dat
similarity index 100%
rename from csdb/collection/288.dat
rename to collection/288.dat
diff --git a/csdb/collection/289.dat b/collection/289.dat
similarity index 100%
rename from csdb/collection/289.dat
rename to collection/289.dat
diff --git a/csdb/collection/290.dat b/collection/290.dat
similarity index 100%
rename from csdb/collection/290.dat
rename to collection/290.dat
diff --git a/csdb/collection/291.dat b/collection/291.dat
similarity index 100%
rename from csdb/collection/291.dat
rename to collection/291.dat
diff --git a/csdb/collection/292.dat b/collection/292.dat
similarity index 100%
rename from csdb/collection/292.dat
rename to collection/292.dat
diff --git a/csdb/collection/293.dat b/collection/293.dat
similarity index 100%
rename from csdb/collection/293.dat
rename to collection/293.dat
diff --git a/csdb/collection/294.dat b/collection/294.dat
similarity index 100%
rename from csdb/collection/294.dat
rename to collection/294.dat
diff --git a/csdb/collection/295.dat b/collection/295.dat
similarity index 100%
rename from csdb/collection/295.dat
rename to collection/295.dat
diff --git a/csdb/collection/296.dat b/collection/296.dat
similarity index 100%
rename from csdb/collection/296.dat
rename to collection/296.dat
diff --git a/csdb/collection/297.dat b/collection/297.dat
similarity index 100%
rename from csdb/collection/297.dat
rename to collection/297.dat
diff --git a/csdb/collection/298.dat b/collection/298.dat
similarity index 100%
rename from csdb/collection/298.dat
rename to collection/298.dat
diff --git a/csdb/collection/299.dat b/collection/299.dat
similarity index 100%
rename from csdb/collection/299.dat
rename to collection/299.dat
diff --git a/csdb/collection/300.dat b/collection/300.dat
similarity index 100%
rename from csdb/collection/300.dat
rename to collection/300.dat
diff --git a/csdb/collection/301.dat b/collection/301.dat
similarity index 100%
rename from csdb/collection/301.dat
rename to collection/301.dat
diff --git a/csdb/collection/302.dat b/collection/302.dat
similarity index 100%
rename from csdb/collection/302.dat
rename to collection/302.dat
diff --git a/csdb/collection/303.dat b/collection/303.dat
similarity index 100%
rename from csdb/collection/303.dat
rename to collection/303.dat
diff --git a/csdb/collection/304.dat b/collection/304.dat
similarity index 100%
rename from csdb/collection/304.dat
rename to collection/304.dat
diff --git a/csdb/collection/305.dat b/collection/305.dat
similarity index 100%
rename from csdb/collection/305.dat
rename to collection/305.dat
diff --git a/csdb/collection/306.dat b/collection/306.dat
similarity index 100%
rename from csdb/collection/306.dat
rename to collection/306.dat
diff --git a/csdb/collection/307.dat b/collection/307.dat
similarity index 100%
rename from csdb/collection/307.dat
rename to collection/307.dat
diff --git a/csdb/collection/308.dat b/collection/308.dat
similarity index 100%
rename from csdb/collection/308.dat
rename to collection/308.dat
diff --git a/csdb/collection/309.dat b/collection/309.dat
similarity index 100%
rename from csdb/collection/309.dat
rename to collection/309.dat
diff --git a/csdb/collection/310.dat b/collection/310.dat
similarity index 100%
rename from csdb/collection/310.dat
rename to collection/310.dat
diff --git a/csdb/collection/311.dat b/collection/311.dat
similarity index 100%
rename from csdb/collection/311.dat
rename to collection/311.dat
diff --git a/csdb/collection/312.dat b/collection/312.dat
similarity index 100%
rename from csdb/collection/312.dat
rename to collection/312.dat
diff --git a/csdb/collection/313.dat b/collection/313.dat
similarity index 100%
rename from csdb/collection/313.dat
rename to collection/313.dat
diff --git a/csdb/collection/314.dat b/collection/314.dat
similarity index 100%
rename from csdb/collection/314.dat
rename to collection/314.dat
diff --git a/csdb/collection/315.dat b/collection/315.dat
similarity index 100%
rename from csdb/collection/315.dat
rename to collection/315.dat
diff --git a/csdb/collection/316.dat b/collection/316.dat
similarity index 100%
rename from csdb/collection/316.dat
rename to collection/316.dat
diff --git a/csdb/collection/317.dat b/collection/317.dat
similarity index 100%
rename from csdb/collection/317.dat
rename to collection/317.dat
diff --git a/csdb/collection/318.dat b/collection/318.dat
similarity index 100%
rename from csdb/collection/318.dat
rename to collection/318.dat
diff --git a/csdb/collection/319.dat b/collection/319.dat
similarity index 100%
rename from csdb/collection/319.dat
rename to collection/319.dat
diff --git a/csdb/collection/320.dat b/collection/320.dat
similarity index 100%
rename from csdb/collection/320.dat
rename to collection/320.dat
diff --git a/csdb/collection/321.dat b/collection/321.dat
similarity index 100%
rename from csdb/collection/321.dat
rename to collection/321.dat
diff --git a/csdb/collection/322.dat b/collection/322.dat
similarity index 100%
rename from csdb/collection/322.dat
rename to collection/322.dat
diff --git a/csdb/collection/323.dat b/collection/323.dat
similarity index 100%
rename from csdb/collection/323.dat
rename to collection/323.dat
diff --git a/csdb/collection/324.dat b/collection/324.dat
similarity index 100%
rename from csdb/collection/324.dat
rename to collection/324.dat
diff --git a/csdb/collection/325.dat b/collection/325.dat
similarity index 100%
rename from csdb/collection/325.dat
rename to collection/325.dat
diff --git a/csdb/collection/326.dat b/collection/326.dat
similarity index 100%
rename from csdb/collection/326.dat
rename to collection/326.dat
diff --git a/csdb/collection/327.dat b/collection/327.dat
similarity index 100%
rename from csdb/collection/327.dat
rename to collection/327.dat
diff --git a/csdb/collection/328.dat b/collection/328.dat
similarity index 100%
rename from csdb/collection/328.dat
rename to collection/328.dat
diff --git a/csdb/collection/329.dat b/collection/329.dat
similarity index 100%
rename from csdb/collection/329.dat
rename to collection/329.dat
diff --git a/csdb/collection/330.dat b/collection/330.dat
similarity index 100%
rename from csdb/collection/330.dat
rename to collection/330.dat
diff --git a/csdb/collection/331.dat b/collection/331.dat
similarity index 100%
rename from csdb/collection/331.dat
rename to collection/331.dat
diff --git a/csdb/collection/332.dat b/collection/332.dat
similarity index 100%
rename from csdb/collection/332.dat
rename to collection/332.dat
diff --git a/csdb/collection/333.dat b/collection/333.dat
similarity index 100%
rename from csdb/collection/333.dat
rename to collection/333.dat
diff --git a/csdb/collection/334.dat b/collection/334.dat
similarity index 100%
rename from csdb/collection/334.dat
rename to collection/334.dat
diff --git a/csdb/collection/335.dat b/collection/335.dat
similarity index 100%
rename from csdb/collection/335.dat
rename to collection/335.dat
diff --git a/csdb/collection/336.dat b/collection/336.dat
similarity index 100%
rename from csdb/collection/336.dat
rename to collection/336.dat
diff --git a/csdb/collection/337.dat b/collection/337.dat
similarity index 100%
rename from csdb/collection/337.dat
rename to collection/337.dat
diff --git a/csdb/collection/338.dat b/collection/338.dat
similarity index 100%
rename from csdb/collection/338.dat
rename to collection/338.dat
diff --git a/csdb/collection/339.dat b/collection/339.dat
similarity index 100%
rename from csdb/collection/339.dat
rename to collection/339.dat
diff --git a/csdb/collection/340.dat b/collection/340.dat
similarity index 100%
rename from csdb/collection/340.dat
rename to collection/340.dat
diff --git a/csdb/collection/341.dat b/collection/341.dat
similarity index 100%
rename from csdb/collection/341.dat
rename to collection/341.dat
diff --git a/csdb/collection/342.dat b/collection/342.dat
similarity index 100%
rename from csdb/collection/342.dat
rename to collection/342.dat
diff --git a/csdb/collection/343.dat b/collection/343.dat
similarity index 100%
rename from csdb/collection/343.dat
rename to collection/343.dat
diff --git a/csdb/collection/344.dat b/collection/344.dat
similarity index 100%
rename from csdb/collection/344.dat
rename to collection/344.dat
diff --git a/csdb/collection/345.dat b/collection/345.dat
similarity index 100%
rename from csdb/collection/345.dat
rename to collection/345.dat
diff --git a/csdb/collection/346.dat b/collection/346.dat
similarity index 100%
rename from csdb/collection/346.dat
rename to collection/346.dat
diff --git a/csdb/collection/347.dat b/collection/347.dat
similarity index 100%
rename from csdb/collection/347.dat
rename to collection/347.dat
diff --git a/csdb/collection/348.dat b/collection/348.dat
similarity index 100%
rename from csdb/collection/348.dat
rename to collection/348.dat
diff --git a/csdb/collection/349.dat b/collection/349.dat
similarity index 100%
rename from csdb/collection/349.dat
rename to collection/349.dat
diff --git a/csdb/collection/350.dat b/collection/350.dat
similarity index 100%
rename from csdb/collection/350.dat
rename to collection/350.dat
diff --git a/csdb/collection/351.dat b/collection/351.dat
similarity index 100%
rename from csdb/collection/351.dat
rename to collection/351.dat
diff --git a/csdb/collection/352.dat b/collection/352.dat
similarity index 100%
rename from csdb/collection/352.dat
rename to collection/352.dat
diff --git a/csdb/collection/353.dat b/collection/353.dat
similarity index 100%
rename from csdb/collection/353.dat
rename to collection/353.dat
diff --git a/csdb/collection/354.dat b/collection/354.dat
similarity index 100%
rename from csdb/collection/354.dat
rename to collection/354.dat
diff --git a/csdb/collection/355.dat b/collection/355.dat
similarity index 100%
rename from csdb/collection/355.dat
rename to collection/355.dat
diff --git a/csdb/collection/356.dat b/collection/356.dat
similarity index 100%
rename from csdb/collection/356.dat
rename to collection/356.dat
diff --git a/csdb/collection/357.dat b/collection/357.dat
similarity index 100%
rename from csdb/collection/357.dat
rename to collection/357.dat
diff --git a/csdb/collection/358.dat b/collection/358.dat
similarity index 100%
rename from csdb/collection/358.dat
rename to collection/358.dat
diff --git a/csdb/collection/359.dat b/collection/359.dat
similarity index 100%
rename from csdb/collection/359.dat
rename to collection/359.dat
diff --git a/csdb/collection/360.dat b/collection/360.dat
similarity index 100%
rename from csdb/collection/360.dat
rename to collection/360.dat
diff --git a/csdb/collection/361.dat b/collection/361.dat
similarity index 100%
rename from csdb/collection/361.dat
rename to collection/361.dat
diff --git a/csdb/collection/362.dat b/collection/362.dat
similarity index 100%
rename from csdb/collection/362.dat
rename to collection/362.dat
diff --git a/csdb/collection/363.dat b/collection/363.dat
similarity index 100%
rename from csdb/collection/363.dat
rename to collection/363.dat
diff --git a/csdb/collection/364.dat b/collection/364.dat
similarity index 100%
rename from csdb/collection/364.dat
rename to collection/364.dat
diff --git a/csdb/collection/365.dat b/collection/365.dat
similarity index 100%
rename from csdb/collection/365.dat
rename to collection/365.dat
diff --git a/csdb/collection/366.dat b/collection/366.dat
similarity index 100%
rename from csdb/collection/366.dat
rename to collection/366.dat
diff --git a/csdb/collection/367.dat b/collection/367.dat
similarity index 100%
rename from csdb/collection/367.dat
rename to collection/367.dat
diff --git a/csdb/collection/368.dat b/collection/368.dat
similarity index 100%
rename from csdb/collection/368.dat
rename to collection/368.dat
diff --git a/csdb/collection/369.dat b/collection/369.dat
similarity index 100%
rename from csdb/collection/369.dat
rename to collection/369.dat
diff --git a/csdb/collection/370.dat b/collection/370.dat
similarity index 100%
rename from csdb/collection/370.dat
rename to collection/370.dat
diff --git a/csdb/collection/371.dat b/collection/371.dat
similarity index 100%
rename from csdb/collection/371.dat
rename to collection/371.dat
diff --git a/csdb/collection/372.dat b/collection/372.dat
similarity index 100%
rename from csdb/collection/372.dat
rename to collection/372.dat
diff --git a/csdb/collection/373.dat b/collection/373.dat
similarity index 100%
rename from csdb/collection/373.dat
rename to collection/373.dat
diff --git a/csdb/collection/374.dat b/collection/374.dat
similarity index 100%
rename from csdb/collection/374.dat
rename to collection/374.dat
diff --git a/csdb/collection/375.dat b/collection/375.dat
similarity index 100%
rename from csdb/collection/375.dat
rename to collection/375.dat
diff --git a/csdb/collection/376.dat b/collection/376.dat
similarity index 100%
rename from csdb/collection/376.dat
rename to collection/376.dat
diff --git a/csdb/collection/377.dat b/collection/377.dat
similarity index 100%
rename from csdb/collection/377.dat
rename to collection/377.dat
diff --git a/csdb/collection/378.dat b/collection/378.dat
similarity index 100%
rename from csdb/collection/378.dat
rename to collection/378.dat
diff --git a/csdb/collection/379.dat b/collection/379.dat
similarity index 100%
rename from csdb/collection/379.dat
rename to collection/379.dat
diff --git a/csdb/collection/380.dat b/collection/380.dat
similarity index 100%
rename from csdb/collection/380.dat
rename to collection/380.dat
diff --git a/csdb/collection/381.dat b/collection/381.dat
similarity index 100%
rename from csdb/collection/381.dat
rename to collection/381.dat
diff --git a/csdb/collection/382.dat b/collection/382.dat
similarity index 100%
rename from csdb/collection/382.dat
rename to collection/382.dat
diff --git a/csdb/collection/383.dat b/collection/383.dat
similarity index 100%
rename from csdb/collection/383.dat
rename to collection/383.dat
diff --git a/csdb/collection/384.dat b/collection/384.dat
similarity index 100%
rename from csdb/collection/384.dat
rename to collection/384.dat
diff --git a/csdb/collection/385.dat b/collection/385.dat
similarity index 100%
rename from csdb/collection/385.dat
rename to collection/385.dat
diff --git a/csdb/collection/386.dat b/collection/386.dat
similarity index 100%
rename from csdb/collection/386.dat
rename to collection/386.dat
diff --git a/csdb/collection/387.dat b/collection/387.dat
similarity index 100%
rename from csdb/collection/387.dat
rename to collection/387.dat
diff --git a/csdb/collection/388.dat b/collection/388.dat
similarity index 100%
rename from csdb/collection/388.dat
rename to collection/388.dat
diff --git a/csdb/collection/389.dat b/collection/389.dat
similarity index 100%
rename from csdb/collection/389.dat
rename to collection/389.dat
diff --git a/csdb/collection/390.dat b/collection/390.dat
similarity index 100%
rename from csdb/collection/390.dat
rename to collection/390.dat
diff --git a/csdb/collection/391.dat b/collection/391.dat
similarity index 100%
rename from csdb/collection/391.dat
rename to collection/391.dat
diff --git a/csdb/collection/392.dat b/collection/392.dat
similarity index 100%
rename from csdb/collection/392.dat
rename to collection/392.dat
diff --git a/csdb/collection/393.dat b/collection/393.dat
similarity index 100%
rename from csdb/collection/393.dat
rename to collection/393.dat
diff --git a/csdb/collection/394.dat b/collection/394.dat
similarity index 100%
rename from csdb/collection/394.dat
rename to collection/394.dat
diff --git a/csdb/collection/395.dat b/collection/395.dat
similarity index 100%
rename from csdb/collection/395.dat
rename to collection/395.dat
diff --git a/csdb/collection/396.dat b/collection/396.dat
similarity index 100%
rename from csdb/collection/396.dat
rename to collection/396.dat
diff --git a/csdb/collection/397.dat b/collection/397.dat
similarity index 100%
rename from csdb/collection/397.dat
rename to collection/397.dat
diff --git a/csdb/collection/398.dat b/collection/398.dat
similarity index 100%
rename from csdb/collection/398.dat
rename to collection/398.dat
diff --git a/csdb/collection/399.dat b/collection/399.dat
similarity index 100%
rename from csdb/collection/399.dat
rename to collection/399.dat
diff --git a/csdb/collection/400.dat b/collection/400.dat
similarity index 100%
rename from csdb/collection/400.dat
rename to collection/400.dat
diff --git a/csdb/collection/401.dat b/collection/401.dat
similarity index 100%
rename from csdb/collection/401.dat
rename to collection/401.dat
diff --git a/csdb/collection/402.dat b/collection/402.dat
similarity index 100%
rename from csdb/collection/402.dat
rename to collection/402.dat
diff --git a/csdb/collection/403.dat b/collection/403.dat
similarity index 100%
rename from csdb/collection/403.dat
rename to collection/403.dat
diff --git a/csdb/collection/404.dat b/collection/404.dat
similarity index 100%
rename from csdb/collection/404.dat
rename to collection/404.dat
diff --git a/csdb/collection/405.dat b/collection/405.dat
similarity index 100%
rename from csdb/collection/405.dat
rename to collection/405.dat
diff --git a/csdb/collection/406.dat b/collection/406.dat
similarity index 100%
rename from csdb/collection/406.dat
rename to collection/406.dat
diff --git a/csdb/collection/407.dat b/collection/407.dat
similarity index 100%
rename from csdb/collection/407.dat
rename to collection/407.dat
diff --git a/csdb/collection/408.dat b/collection/408.dat
similarity index 100%
rename from csdb/collection/408.dat
rename to collection/408.dat
diff --git a/csdb/collection/409.dat b/collection/409.dat
similarity index 100%
rename from csdb/collection/409.dat
rename to collection/409.dat
diff --git a/csdb/collection/410.dat b/collection/410.dat
similarity index 100%
rename from csdb/collection/410.dat
rename to collection/410.dat
diff --git a/csdb/collection/411.dat b/collection/411.dat
similarity index 100%
rename from csdb/collection/411.dat
rename to collection/411.dat
diff --git a/csdb/collection/412.dat b/collection/412.dat
similarity index 100%
rename from csdb/collection/412.dat
rename to collection/412.dat
diff --git a/csdb/collection/413.dat b/collection/413.dat
similarity index 100%
rename from csdb/collection/413.dat
rename to collection/413.dat
diff --git a/csdb/collection/414.dat b/collection/414.dat
similarity index 100%
rename from csdb/collection/414.dat
rename to collection/414.dat
diff --git a/csdb/collection/415.dat b/collection/415.dat
similarity index 100%
rename from csdb/collection/415.dat
rename to collection/415.dat
diff --git a/csdb/collection/416.dat b/collection/416.dat
similarity index 100%
rename from csdb/collection/416.dat
rename to collection/416.dat
diff --git a/csdb/collection/417.dat b/collection/417.dat
similarity index 100%
rename from csdb/collection/417.dat
rename to collection/417.dat
diff --git a/csdb/collection/418.dat b/collection/418.dat
similarity index 100%
rename from csdb/collection/418.dat
rename to collection/418.dat
diff --git a/csdb/collection/419.dat b/collection/419.dat
similarity index 100%
rename from csdb/collection/419.dat
rename to collection/419.dat
diff --git a/csdb/collection/420.dat b/collection/420.dat
similarity index 100%
rename from csdb/collection/420.dat
rename to collection/420.dat
diff --git a/csdb/collection/421.dat b/collection/421.dat
similarity index 100%
rename from csdb/collection/421.dat
rename to collection/421.dat
diff --git a/csdb/collection/422.dat b/collection/422.dat
similarity index 100%
rename from csdb/collection/422.dat
rename to collection/422.dat
diff --git a/csdb/collection/423.dat b/collection/423.dat
similarity index 100%
rename from csdb/collection/423.dat
rename to collection/423.dat
diff --git a/csdb/collection/424.dat b/collection/424.dat
similarity index 100%
rename from csdb/collection/424.dat
rename to collection/424.dat
diff --git a/csdb/collection/425.dat b/collection/425.dat
similarity index 100%
rename from csdb/collection/425.dat
rename to collection/425.dat
diff --git a/csdb/collection/426.dat b/collection/426.dat
similarity index 100%
rename from csdb/collection/426.dat
rename to collection/426.dat
diff --git a/csdb/collection/427.dat b/collection/427.dat
similarity index 100%
rename from csdb/collection/427.dat
rename to collection/427.dat
diff --git a/csdb/collection/428.dat b/collection/428.dat
similarity index 100%
rename from csdb/collection/428.dat
rename to collection/428.dat
diff --git a/csdb/collection/429.dat b/collection/429.dat
similarity index 100%
rename from csdb/collection/429.dat
rename to collection/429.dat
diff --git a/csdb/collection/430.dat b/collection/430.dat
similarity index 100%
rename from csdb/collection/430.dat
rename to collection/430.dat
diff --git a/csdb/collection/431.dat b/collection/431.dat
similarity index 100%
rename from csdb/collection/431.dat
rename to collection/431.dat
diff --git a/csdb/collection/432.dat b/collection/432.dat
similarity index 100%
rename from csdb/collection/432.dat
rename to collection/432.dat
diff --git a/csdb/collection/433.dat b/collection/433.dat
similarity index 100%
rename from csdb/collection/433.dat
rename to collection/433.dat
diff --git a/csdb/collection/434.dat b/collection/434.dat
similarity index 100%
rename from csdb/collection/434.dat
rename to collection/434.dat
diff --git a/csdb/collection/435.dat b/collection/435.dat
similarity index 100%
rename from csdb/collection/435.dat
rename to collection/435.dat
diff --git a/csdb/collection/436.dat b/collection/436.dat
similarity index 100%
rename from csdb/collection/436.dat
rename to collection/436.dat
diff --git a/csdb/collection/437.dat b/collection/437.dat
similarity index 100%
rename from csdb/collection/437.dat
rename to collection/437.dat
diff --git a/csdb/collection/438.dat b/collection/438.dat
similarity index 100%
rename from csdb/collection/438.dat
rename to collection/438.dat
diff --git a/csdb/collection/439.dat b/collection/439.dat
similarity index 100%
rename from csdb/collection/439.dat
rename to collection/439.dat
diff --git a/csdb/collection/440.dat b/collection/440.dat
similarity index 100%
rename from csdb/collection/440.dat
rename to collection/440.dat
diff --git a/csdb/collection/441.dat b/collection/441.dat
similarity index 100%
rename from csdb/collection/441.dat
rename to collection/441.dat
diff --git a/csdb/collection/442.dat b/collection/442.dat
similarity index 100%
rename from csdb/collection/442.dat
rename to collection/442.dat
diff --git a/csdb/collection/443.dat b/collection/443.dat
similarity index 100%
rename from csdb/collection/443.dat
rename to collection/443.dat
diff --git a/csdb/collection/444.dat b/collection/444.dat
similarity index 100%
rename from csdb/collection/444.dat
rename to collection/444.dat
diff --git a/csdb/collection/445.dat b/collection/445.dat
similarity index 100%
rename from csdb/collection/445.dat
rename to collection/445.dat
diff --git a/csdb/collection/446.dat b/collection/446.dat
similarity index 100%
rename from csdb/collection/446.dat
rename to collection/446.dat
diff --git a/csdb/collection/447.dat b/collection/447.dat
similarity index 100%
rename from csdb/collection/447.dat
rename to collection/447.dat
diff --git a/csdb/collection/448.dat b/collection/448.dat
similarity index 100%
rename from csdb/collection/448.dat
rename to collection/448.dat
diff --git a/csdb/collection/449.dat b/collection/449.dat
similarity index 100%
rename from csdb/collection/449.dat
rename to collection/449.dat
diff --git a/csdb/collection/450.dat b/collection/450.dat
similarity index 100%
rename from csdb/collection/450.dat
rename to collection/450.dat
diff --git a/csdb/collection/451.dat b/collection/451.dat
similarity index 100%
rename from csdb/collection/451.dat
rename to collection/451.dat
diff --git a/csdb/collection/452.dat b/collection/452.dat
similarity index 100%
rename from csdb/collection/452.dat
rename to collection/452.dat
diff --git a/csdb/collection/453.dat b/collection/453.dat
similarity index 100%
rename from csdb/collection/453.dat
rename to collection/453.dat
diff --git a/csdb/collection/454.dat b/collection/454.dat
similarity index 100%
rename from csdb/collection/454.dat
rename to collection/454.dat
diff --git a/csdb/collection/455.dat b/collection/455.dat
similarity index 100%
rename from csdb/collection/455.dat
rename to collection/455.dat
diff --git a/csdb/collection/456.dat b/collection/456.dat
similarity index 100%
rename from csdb/collection/456.dat
rename to collection/456.dat
diff --git a/csdb/collection/457.dat b/collection/457.dat
similarity index 100%
rename from csdb/collection/457.dat
rename to collection/457.dat
diff --git a/csdb/collection/458.dat b/collection/458.dat
similarity index 100%
rename from csdb/collection/458.dat
rename to collection/458.dat
diff --git a/csdb/collection/459.dat b/collection/459.dat
similarity index 100%
rename from csdb/collection/459.dat
rename to collection/459.dat
diff --git a/csdb/collection/460.dat b/collection/460.dat
similarity index 100%
rename from csdb/collection/460.dat
rename to collection/460.dat
diff --git a/csdb/collection/461.dat b/collection/461.dat
similarity index 100%
rename from csdb/collection/461.dat
rename to collection/461.dat
diff --git a/csdb/collection/462.dat b/collection/462.dat
similarity index 100%
rename from csdb/collection/462.dat
rename to collection/462.dat
diff --git a/csdb/collection/463.dat b/collection/463.dat
similarity index 100%
rename from csdb/collection/463.dat
rename to collection/463.dat
diff --git a/csdb/collection/464.dat b/collection/464.dat
similarity index 100%
rename from csdb/collection/464.dat
rename to collection/464.dat
diff --git a/csdb/collection/465.dat b/collection/465.dat
similarity index 100%
rename from csdb/collection/465.dat
rename to collection/465.dat
diff --git a/csdb/collection/466.dat b/collection/466.dat
similarity index 100%
rename from csdb/collection/466.dat
rename to collection/466.dat
diff --git a/csdb/collection/467.dat b/collection/467.dat
similarity index 100%
rename from csdb/collection/467.dat
rename to collection/467.dat
diff --git a/csdb/collection/468.dat b/collection/468.dat
similarity index 100%
rename from csdb/collection/468.dat
rename to collection/468.dat
diff --git a/csdb/collection/469.dat b/collection/469.dat
similarity index 100%
rename from csdb/collection/469.dat
rename to collection/469.dat
diff --git a/csdb/collection/470.dat b/collection/470.dat
similarity index 100%
rename from csdb/collection/470.dat
rename to collection/470.dat
diff --git a/csdb/collection/471.dat b/collection/471.dat
similarity index 100%
rename from csdb/collection/471.dat
rename to collection/471.dat
diff --git a/csdb/collection/472.dat b/collection/472.dat
similarity index 100%
rename from csdb/collection/472.dat
rename to collection/472.dat
diff --git a/csdb/collection/473.dat b/collection/473.dat
similarity index 100%
rename from csdb/collection/473.dat
rename to collection/473.dat
diff --git a/csdb/collection/474.dat b/collection/474.dat
similarity index 100%
rename from csdb/collection/474.dat
rename to collection/474.dat
diff --git a/csdb/collection/475.dat b/collection/475.dat
similarity index 100%
rename from csdb/collection/475.dat
rename to collection/475.dat
diff --git a/csdb/collection/476.dat b/collection/476.dat
similarity index 100%
rename from csdb/collection/476.dat
rename to collection/476.dat
diff --git a/csdb/collection/477.dat b/collection/477.dat
similarity index 100%
rename from csdb/collection/477.dat
rename to collection/477.dat
diff --git a/csdb/collection/478.dat b/collection/478.dat
similarity index 100%
rename from csdb/collection/478.dat
rename to collection/478.dat
diff --git a/csdb/collection/479.dat b/collection/479.dat
similarity index 100%
rename from csdb/collection/479.dat
rename to collection/479.dat
diff --git a/csdb/collection/480.dat b/collection/480.dat
similarity index 100%
rename from csdb/collection/480.dat
rename to collection/480.dat
diff --git a/csdb/collection/481.dat b/collection/481.dat
similarity index 100%
rename from csdb/collection/481.dat
rename to collection/481.dat
diff --git a/csdb/collection/482.dat b/collection/482.dat
similarity index 100%
rename from csdb/collection/482.dat
rename to collection/482.dat
diff --git a/csdb/collection/483.dat b/collection/483.dat
similarity index 100%
rename from csdb/collection/483.dat
rename to collection/483.dat
diff --git a/csdb/collection/484.dat b/collection/484.dat
similarity index 100%
rename from csdb/collection/484.dat
rename to collection/484.dat
diff --git a/csdb/collection/485.dat b/collection/485.dat
similarity index 100%
rename from csdb/collection/485.dat
rename to collection/485.dat
diff --git a/csdb/collection/486.dat b/collection/486.dat
similarity index 100%
rename from csdb/collection/486.dat
rename to collection/486.dat
diff --git a/csdb/collection/487.dat b/collection/487.dat
similarity index 100%
rename from csdb/collection/487.dat
rename to collection/487.dat
diff --git a/csdb/collection/488.dat b/collection/488.dat
similarity index 100%
rename from csdb/collection/488.dat
rename to collection/488.dat
diff --git a/csdb/collection/489.dat b/collection/489.dat
similarity index 100%
rename from csdb/collection/489.dat
rename to collection/489.dat
diff --git a/csdb/collection/490.dat b/collection/490.dat
similarity index 100%
rename from csdb/collection/490.dat
rename to collection/490.dat
diff --git a/csdb/collection/491.dat b/collection/491.dat
similarity index 100%
rename from csdb/collection/491.dat
rename to collection/491.dat
diff --git a/csdb/collection/492.dat b/collection/492.dat
similarity index 100%
rename from csdb/collection/492.dat
rename to collection/492.dat
diff --git a/csdb/collection/493.dat b/collection/493.dat
similarity index 100%
rename from csdb/collection/493.dat
rename to collection/493.dat
diff --git a/csdb/collection/494.dat b/collection/494.dat
similarity index 100%
rename from csdb/collection/494.dat
rename to collection/494.dat
diff --git a/csdb/collection/495.dat b/collection/495.dat
similarity index 100%
rename from csdb/collection/495.dat
rename to collection/495.dat
diff --git a/csdb/collection/496.dat b/collection/496.dat
similarity index 100%
rename from csdb/collection/496.dat
rename to collection/496.dat
diff --git a/csdb/collection/497.dat b/collection/497.dat
similarity index 100%
rename from csdb/collection/497.dat
rename to collection/497.dat
diff --git a/csdb/collection/498.dat b/collection/498.dat
similarity index 100%
rename from csdb/collection/498.dat
rename to collection/498.dat
diff --git a/csdb/collection/499.dat b/collection/499.dat
similarity index 100%
rename from csdb/collection/499.dat
rename to collection/499.dat
diff --git a/csdb/collection/500.dat b/collection/500.dat
similarity index 100%
rename from csdb/collection/500.dat
rename to collection/500.dat
diff --git a/csdb/collection/501.dat b/collection/501.dat
similarity index 100%
rename from csdb/collection/501.dat
rename to collection/501.dat
diff --git a/csdb/collection/502.dat b/collection/502.dat
similarity index 100%
rename from csdb/collection/502.dat
rename to collection/502.dat
diff --git a/csdb/collection/503.dat b/collection/503.dat
similarity index 100%
rename from csdb/collection/503.dat
rename to collection/503.dat
diff --git a/csdb/collection/504.dat b/collection/504.dat
similarity index 100%
rename from csdb/collection/504.dat
rename to collection/504.dat
diff --git a/csdb/collection/505.dat b/collection/505.dat
similarity index 100%
rename from csdb/collection/505.dat
rename to collection/505.dat
diff --git a/csdb/collection/506.dat b/collection/506.dat
similarity index 100%
rename from csdb/collection/506.dat
rename to collection/506.dat
diff --git a/csdb/collection/507.dat b/collection/507.dat
similarity index 100%
rename from csdb/collection/507.dat
rename to collection/507.dat
diff --git a/csdb/collection/508.dat b/collection/508.dat
similarity index 100%
rename from csdb/collection/508.dat
rename to collection/508.dat
diff --git a/csdb/collection/509.dat b/collection/509.dat
similarity index 100%
rename from csdb/collection/509.dat
rename to collection/509.dat
diff --git a/csdb/collection/510.dat b/collection/510.dat
similarity index 100%
rename from csdb/collection/510.dat
rename to collection/510.dat
diff --git a/csdb/collection/511.dat b/collection/511.dat
similarity index 100%
rename from csdb/collection/511.dat
rename to collection/511.dat
diff --git a/csdb/collection/512.dat b/collection/512.dat
similarity index 100%
rename from csdb/collection/512.dat
rename to collection/512.dat
diff --git a/csdb/collection/513.dat b/collection/513.dat
similarity index 100%
rename from csdb/collection/513.dat
rename to collection/513.dat
diff --git a/csdb/collection/514.dat b/collection/514.dat
similarity index 100%
rename from csdb/collection/514.dat
rename to collection/514.dat
diff --git a/csdb/collection/515.dat b/collection/515.dat
similarity index 100%
rename from csdb/collection/515.dat
rename to collection/515.dat
diff --git a/csdb/collection/516.dat b/collection/516.dat
similarity index 100%
rename from csdb/collection/516.dat
rename to collection/516.dat
diff --git a/csdb/collection/517.dat b/collection/517.dat
similarity index 100%
rename from csdb/collection/517.dat
rename to collection/517.dat
diff --git a/csdb/collection/518.dat b/collection/518.dat
similarity index 100%
rename from csdb/collection/518.dat
rename to collection/518.dat
diff --git a/csdb/collection/519.dat b/collection/519.dat
similarity index 100%
rename from csdb/collection/519.dat
rename to collection/519.dat
diff --git a/csdb/collection/520.dat b/collection/520.dat
similarity index 100%
rename from csdb/collection/520.dat
rename to collection/520.dat
diff --git a/csdb/collection/521.dat b/collection/521.dat
similarity index 100%
rename from csdb/collection/521.dat
rename to collection/521.dat
diff --git a/csdb/collection/522.dat b/collection/522.dat
similarity index 100%
rename from csdb/collection/522.dat
rename to collection/522.dat
diff --git a/csdb/collection/523.dat b/collection/523.dat
similarity index 100%
rename from csdb/collection/523.dat
rename to collection/523.dat
diff --git a/csdb/collection/524.dat b/collection/524.dat
similarity index 100%
rename from csdb/collection/524.dat
rename to collection/524.dat
diff --git a/csdb/collection/525.dat b/collection/525.dat
similarity index 100%
rename from csdb/collection/525.dat
rename to collection/525.dat
diff --git a/csdb/collection/526.dat b/collection/526.dat
similarity index 100%
rename from csdb/collection/526.dat
rename to collection/526.dat
diff --git a/csdb/collection/527.dat b/collection/527.dat
similarity index 100%
rename from csdb/collection/527.dat
rename to collection/527.dat
diff --git a/csdb/collection/528.dat b/collection/528.dat
similarity index 100%
rename from csdb/collection/528.dat
rename to collection/528.dat
diff --git a/csdb/collection/529.dat b/collection/529.dat
similarity index 100%
rename from csdb/collection/529.dat
rename to collection/529.dat
diff --git a/csdb/collection/530.dat b/collection/530.dat
similarity index 100%
rename from csdb/collection/530.dat
rename to collection/530.dat
diff --git a/csdb/collection/531.dat b/collection/531.dat
similarity index 100%
rename from csdb/collection/531.dat
rename to collection/531.dat
diff --git a/csdb/collection/532.dat b/collection/532.dat
similarity index 100%
rename from csdb/collection/532.dat
rename to collection/532.dat
diff --git a/csdb/collection/533.dat b/collection/533.dat
similarity index 100%
rename from csdb/collection/533.dat
rename to collection/533.dat
diff --git a/csdb/collection/534.dat b/collection/534.dat
similarity index 100%
rename from csdb/collection/534.dat
rename to collection/534.dat
diff --git a/csdb/collection/535.dat b/collection/535.dat
similarity index 100%
rename from csdb/collection/535.dat
rename to collection/535.dat
diff --git a/csdb/collection/536.dat b/collection/536.dat
similarity index 100%
rename from csdb/collection/536.dat
rename to collection/536.dat
diff --git a/csdb/collection/537.dat b/collection/537.dat
similarity index 100%
rename from csdb/collection/537.dat
rename to collection/537.dat
diff --git a/csdb/collection/538.dat b/collection/538.dat
similarity index 100%
rename from csdb/collection/538.dat
rename to collection/538.dat
diff --git a/csdb/collection/539.dat b/collection/539.dat
similarity index 100%
rename from csdb/collection/539.dat
rename to collection/539.dat
diff --git a/csdb/collection/540.dat b/collection/540.dat
similarity index 100%
rename from csdb/collection/540.dat
rename to collection/540.dat
diff --git a/csdb/collection/541.dat b/collection/541.dat
similarity index 100%
rename from csdb/collection/541.dat
rename to collection/541.dat
diff --git a/csdb/collection/542.dat b/collection/542.dat
similarity index 100%
rename from csdb/collection/542.dat
rename to collection/542.dat
diff --git a/csdb/collection/543.dat b/collection/543.dat
similarity index 100%
rename from csdb/collection/543.dat
rename to collection/543.dat
diff --git a/csdb/collection/544.dat b/collection/544.dat
similarity index 100%
rename from csdb/collection/544.dat
rename to collection/544.dat
diff --git a/csdb/collection/545.dat b/collection/545.dat
similarity index 100%
rename from csdb/collection/545.dat
rename to collection/545.dat
diff --git a/csdb/collection/546.dat b/collection/546.dat
similarity index 100%
rename from csdb/collection/546.dat
rename to collection/546.dat
diff --git a/csdb/collection/547.dat b/collection/547.dat
similarity index 100%
rename from csdb/collection/547.dat
rename to collection/547.dat
diff --git a/csdb/collection/548.dat b/collection/548.dat
similarity index 100%
rename from csdb/collection/548.dat
rename to collection/548.dat
diff --git a/csdb/collection/549.dat b/collection/549.dat
similarity index 100%
rename from csdb/collection/549.dat
rename to collection/549.dat
diff --git a/csdb/collection/550.dat b/collection/550.dat
similarity index 100%
rename from csdb/collection/550.dat
rename to collection/550.dat
diff --git a/csdb/collection/551.dat b/collection/551.dat
similarity index 100%
rename from csdb/collection/551.dat
rename to collection/551.dat
diff --git a/csdb/collection/552.dat b/collection/552.dat
similarity index 100%
rename from csdb/collection/552.dat
rename to collection/552.dat
diff --git a/csdb/collection/553.dat b/collection/553.dat
similarity index 100%
rename from csdb/collection/553.dat
rename to collection/553.dat
diff --git a/csdb/collection/554.dat b/collection/554.dat
similarity index 100%
rename from csdb/collection/554.dat
rename to collection/554.dat
diff --git a/csdb/collection/555.dat b/collection/555.dat
similarity index 100%
rename from csdb/collection/555.dat
rename to collection/555.dat
diff --git a/csdb/collection/556.dat b/collection/556.dat
similarity index 100%
rename from csdb/collection/556.dat
rename to collection/556.dat
diff --git a/csdb/collection/557.dat b/collection/557.dat
similarity index 100%
rename from csdb/collection/557.dat
rename to collection/557.dat
diff --git a/csdb/collection/558.dat b/collection/558.dat
similarity index 100%
rename from csdb/collection/558.dat
rename to collection/558.dat
diff --git a/csdb/collection/559.dat b/collection/559.dat
similarity index 100%
rename from csdb/collection/559.dat
rename to collection/559.dat
diff --git a/csdb/collection/560.dat b/collection/560.dat
similarity index 100%
rename from csdb/collection/560.dat
rename to collection/560.dat
diff --git a/csdb/collection/561.dat b/collection/561.dat
similarity index 100%
rename from csdb/collection/561.dat
rename to collection/561.dat
diff --git a/csdb/collection/562.dat b/collection/562.dat
similarity index 100%
rename from csdb/collection/562.dat
rename to collection/562.dat
diff --git a/csdb/collection/563.dat b/collection/563.dat
similarity index 100%
rename from csdb/collection/563.dat
rename to collection/563.dat
diff --git a/csdb/collection/564.dat b/collection/564.dat
similarity index 100%
rename from csdb/collection/564.dat
rename to collection/564.dat
diff --git a/csdb/collection/565.dat b/collection/565.dat
similarity index 100%
rename from csdb/collection/565.dat
rename to collection/565.dat
diff --git a/csdb/collection/566.dat b/collection/566.dat
similarity index 100%
rename from csdb/collection/566.dat
rename to collection/566.dat
diff --git a/csdb/collection/567.dat b/collection/567.dat
similarity index 100%
rename from csdb/collection/567.dat
rename to collection/567.dat
diff --git a/csdb/collection/568.dat b/collection/568.dat
similarity index 100%
rename from csdb/collection/568.dat
rename to collection/568.dat
diff --git a/csdb/collection/569.dat b/collection/569.dat
similarity index 100%
rename from csdb/collection/569.dat
rename to collection/569.dat
diff --git a/csdb/collection/570.dat b/collection/570.dat
similarity index 100%
rename from csdb/collection/570.dat
rename to collection/570.dat
diff --git a/csdb/collection/571.dat b/collection/571.dat
similarity index 100%
rename from csdb/collection/571.dat
rename to collection/571.dat
diff --git a/csdb/collection/572.dat b/collection/572.dat
similarity index 100%
rename from csdb/collection/572.dat
rename to collection/572.dat
diff --git a/csdb/collection/573.dat b/collection/573.dat
similarity index 100%
rename from csdb/collection/573.dat
rename to collection/573.dat
diff --git a/csdb/collection/574.dat b/collection/574.dat
similarity index 100%
rename from csdb/collection/574.dat
rename to collection/574.dat
diff --git a/csdb/collection/575.dat b/collection/575.dat
similarity index 100%
rename from csdb/collection/575.dat
rename to collection/575.dat
diff --git a/csdb/collection/576.dat b/collection/576.dat
similarity index 100%
rename from csdb/collection/576.dat
rename to collection/576.dat
diff --git a/csdb/collection/577.dat b/collection/577.dat
similarity index 100%
rename from csdb/collection/577.dat
rename to collection/577.dat
diff --git a/csdb/collection/578.dat b/collection/578.dat
similarity index 100%
rename from csdb/collection/578.dat
rename to collection/578.dat
diff --git a/csdb/collection/579.dat b/collection/579.dat
similarity index 100%
rename from csdb/collection/579.dat
rename to collection/579.dat
diff --git a/csdb/collection/580.dat b/collection/580.dat
similarity index 100%
rename from csdb/collection/580.dat
rename to collection/580.dat
diff --git a/csdb/collection/581.dat b/collection/581.dat
similarity index 100%
rename from csdb/collection/581.dat
rename to collection/581.dat
diff --git a/csdb/collection/582.dat b/collection/582.dat
similarity index 100%
rename from csdb/collection/582.dat
rename to collection/582.dat
diff --git a/csdb/collection/583.dat b/collection/583.dat
similarity index 100%
rename from csdb/collection/583.dat
rename to collection/583.dat
diff --git a/csdb/collection/584.dat b/collection/584.dat
similarity index 100%
rename from csdb/collection/584.dat
rename to collection/584.dat
diff --git a/csdb/collection/585.dat b/collection/585.dat
similarity index 100%
rename from csdb/collection/585.dat
rename to collection/585.dat
diff --git a/csdb/collection/586.dat b/collection/586.dat
similarity index 100%
rename from csdb/collection/586.dat
rename to collection/586.dat
diff --git a/csdb/collection/587.dat b/collection/587.dat
similarity index 100%
rename from csdb/collection/587.dat
rename to collection/587.dat
diff --git a/csdb/collection/588.dat b/collection/588.dat
similarity index 100%
rename from csdb/collection/588.dat
rename to collection/588.dat
diff --git a/csdb/collection/589.dat b/collection/589.dat
similarity index 100%
rename from csdb/collection/589.dat
rename to collection/589.dat
diff --git a/csdb/collection/590.dat b/collection/590.dat
similarity index 100%
rename from csdb/collection/590.dat
rename to collection/590.dat
diff --git a/csdb/collection/591.dat b/collection/591.dat
similarity index 100%
rename from csdb/collection/591.dat
rename to collection/591.dat
diff --git a/csdb/collection/592.dat b/collection/592.dat
similarity index 100%
rename from csdb/collection/592.dat
rename to collection/592.dat
diff --git a/csdb/collection/593.dat b/collection/593.dat
similarity index 100%
rename from csdb/collection/593.dat
rename to collection/593.dat
diff --git a/csdb/collection/594.dat b/collection/594.dat
similarity index 100%
rename from csdb/collection/594.dat
rename to collection/594.dat
diff --git a/csdb/collection/595.dat b/collection/595.dat
similarity index 100%
rename from csdb/collection/595.dat
rename to collection/595.dat
diff --git a/csdb/collection/596.dat b/collection/596.dat
similarity index 100%
rename from csdb/collection/596.dat
rename to collection/596.dat
diff --git a/csdb/collection/597.dat b/collection/597.dat
similarity index 100%
rename from csdb/collection/597.dat
rename to collection/597.dat
diff --git a/csdb/collection/598.dat b/collection/598.dat
similarity index 100%
rename from csdb/collection/598.dat
rename to collection/598.dat
diff --git a/csdb/collection/599.dat b/collection/599.dat
similarity index 100%
rename from csdb/collection/599.dat
rename to collection/599.dat
diff --git a/csdb/collection/600.dat b/collection/600.dat
similarity index 100%
rename from csdb/collection/600.dat
rename to collection/600.dat
diff --git a/csdb/collection/601.dat b/collection/601.dat
similarity index 100%
rename from csdb/collection/601.dat
rename to collection/601.dat
diff --git a/csdb/collection/602.dat b/collection/602.dat
similarity index 100%
rename from csdb/collection/602.dat
rename to collection/602.dat
diff --git a/csdb/collection/603.dat b/collection/603.dat
similarity index 100%
rename from csdb/collection/603.dat
rename to collection/603.dat
diff --git a/csdb/collection/604.dat b/collection/604.dat
similarity index 100%
rename from csdb/collection/604.dat
rename to collection/604.dat
diff --git a/csdb/collection/605.dat b/collection/605.dat
similarity index 100%
rename from csdb/collection/605.dat
rename to collection/605.dat
diff --git a/csdb/collection/606.dat b/collection/606.dat
similarity index 100%
rename from csdb/collection/606.dat
rename to collection/606.dat
diff --git a/csdb/collection/607.dat b/collection/607.dat
similarity index 100%
rename from csdb/collection/607.dat
rename to collection/607.dat
diff --git a/csdb/collection/608.dat b/collection/608.dat
similarity index 100%
rename from csdb/collection/608.dat
rename to collection/608.dat
diff --git a/csdb/collection/609.dat b/collection/609.dat
similarity index 100%
rename from csdb/collection/609.dat
rename to collection/609.dat
diff --git a/csdb/collection/610.dat b/collection/610.dat
similarity index 100%
rename from csdb/collection/610.dat
rename to collection/610.dat
diff --git a/csdb/collection/611.dat b/collection/611.dat
similarity index 100%
rename from csdb/collection/611.dat
rename to collection/611.dat
diff --git a/csdb/collection/612.dat b/collection/612.dat
similarity index 100%
rename from csdb/collection/612.dat
rename to collection/612.dat
diff --git a/csdb/collection/613.dat b/collection/613.dat
similarity index 100%
rename from csdb/collection/613.dat
rename to collection/613.dat
diff --git a/csdb/collection/614.dat b/collection/614.dat
similarity index 100%
rename from csdb/collection/614.dat
rename to collection/614.dat
diff --git a/csdb/collection/615.dat b/collection/615.dat
similarity index 100%
rename from csdb/collection/615.dat
rename to collection/615.dat
diff --git a/csdb/collection/616.dat b/collection/616.dat
similarity index 100%
rename from csdb/collection/616.dat
rename to collection/616.dat
diff --git a/csdb/collection/617.dat b/collection/617.dat
similarity index 100%
rename from csdb/collection/617.dat
rename to collection/617.dat
diff --git a/csdb/collection/618.dat b/collection/618.dat
similarity index 100%
rename from csdb/collection/618.dat
rename to collection/618.dat
diff --git a/csdb/collection/619.dat b/collection/619.dat
similarity index 100%
rename from csdb/collection/619.dat
rename to collection/619.dat
diff --git a/csdb/collection/620.dat b/collection/620.dat
similarity index 100%
rename from csdb/collection/620.dat
rename to collection/620.dat
diff --git a/csdb/collection/621.dat b/collection/621.dat
similarity index 100%
rename from csdb/collection/621.dat
rename to collection/621.dat
diff --git a/csdb/collection/622.dat b/collection/622.dat
similarity index 100%
rename from csdb/collection/622.dat
rename to collection/622.dat
diff --git a/csdb/collection/623.dat b/collection/623.dat
similarity index 51%
rename from csdb/collection/623.dat
rename to collection/623.dat
index 396f16e..15dfa7d 100644
--- a/csdb/collection/623.dat
+++ b/collection/623.dat
@@ -3,24 +3,51 @@
public
// Returns first element of given array, which must not be empty.
class function First(const A: array of T): T; static;
+
// Returns last element of given array, which must not be empty.
class function Last(const A: array of T): T; static;
+
// Returns index of given item in given array or -1 if element no in array.
// Given equality comparer is used to compare array elements with Elem.
class function IndexOf(const Item: T; const A: array of T;
const EqualityComparer: Generics.Defaults.TEqualityComparison):
Integer; static;
+
// Checks if two given arrays have the same contents, in same order. Given
// equality comparer is used to compare array elements.
class function Equal(const Left, Right: array of T;
const EqualityComparer: Generics.Defaults.TEqualityComparison):
Boolean; static;
+
// Checks if the first Count elements of the given arrays are the same.
// Given equality comparer is used to compare array elements.
class function SameStart(const Left, Right: array of T;
const Count: Integer;
const EqualityComparer: Generics.Defaults.TEqualityComparison):
Boolean; static;
+
+ // Creates and returns a new array that is the reverse of the given array.
+ class function Reverse(const A: array of T): TArray; static;
+
+ // Returns the maximum value of array A, which must not be be empty. The
+ // given comparer must return -ve if its 1st argument is less than the 2nd
+ // argument, +ve if the reverse holds and zero if both arguments are equal.
+ class function Max(const A: array of T; const Comparer: TComparison):
+ T; static;
+
+ // Returns the minimum value of array A, which must not be be empty. The
+ // given comparer must return -ve if its 1st argument is less than the 2nd
+ // argument, +ve if the reverse holds and zero if both arguments are equal.
+ class function Min(const A: array of T; const Comparer: TComparison):
+ T; static;
+
+ // Finds the minimum and maximum value of array A, which must not be empty.
+ // The minimum and maximum are returned via the MinValue and MaxValue
+ // parameters respectively. The given comparer must return -ve if its 1st
+ // argument is less than the 2nd argument, +ve if the reverse holds and zero
+ // if both arguments are equal.
+ class procedure MinMax(const A: array of T;
+ const Comparer: TComparison; out MinValue, MaxValue: T); static;
end;
class function TArrayUtils.Equal(const Left, Right: array of T;
@@ -60,6 +87,56 @@ begin
Result := A[Pred(Length(A))];
end;
+class function TArrayUtils.Max(const A: array of T;
+ const Comparer: TComparison): T;
+var
+ Idx: Integer;
+begin
+ Assert(System.Length(A) > 0);
+ Result := A[0];
+ for Idx := 1 to Pred(System.Length(A)) do
+ if Comparer(A[Idx], Result) > 0 then
+ Result := A[Idx];
+end;
+
+class function TArrayUtils.Min(const A: array of T;
+ const Comparer: TComparison): T;
+var
+ Idx: Integer;
+begin
+ Assert(System.Length(A) > 0);
+ Result := A[0];
+ for Idx := 1 to Pred(System.Length(A)) do
+ if Comparer(A[Idx], Result) < 0 then
+ Result := A[Idx];
+end;
+
+class procedure TArrayUtils.MinMax(const A: array of T;
+ const Comparer: TComparison; out MinValue, MaxValue: T);
+var
+ Idx: Integer;
+begin
+ Assert(System.Length(A) > 0);
+ MinValue := A[0];
+ MaxValue := A[0];
+ for Idx := 1 to Pred(System.Length(A)) do
+ begin
+ if Comparer(A[Idx], MinValue) < 0 then
+ MinValue := A[Idx]
+ else if Comparer(A[Idx], MaxValue) > 0 then
+ MaxValue := A[Idx];
+ end;
+end;
+
+class function TArrayUtils.Reverse(const A: array of T): TArray;
+var
+ I: Integer;
+begin
+ SetLength(Result, Length(A));
+ for I := 0 to High(A) do
+ Result[High(A)-I] := A[I];
+end;
+
class function TArrayUtils.SameStart(const Left, Right: array of T;
const Count: Integer;
const EqualityComparer: Generics.Defaults.TEqualityComparison): Boolean;
diff --git a/csdb/collection/624.dat b/collection/624.dat
similarity index 100%
rename from csdb/collection/624.dat
rename to collection/624.dat
diff --git a/csdb/collection/625.dat b/collection/625.dat
similarity index 100%
rename from csdb/collection/625.dat
rename to collection/625.dat
diff --git a/csdb/collection/626.dat b/collection/626.dat
similarity index 100%
rename from csdb/collection/626.dat
rename to collection/626.dat
diff --git a/csdb/collection/627.dat b/collection/627.dat
similarity index 100%
rename from csdb/collection/627.dat
rename to collection/627.dat
diff --git a/csdb/collection/628.dat b/collection/628.dat
similarity index 100%
rename from csdb/collection/628.dat
rename to collection/628.dat
diff --git a/csdb/collection/629.dat b/collection/629.dat
similarity index 100%
rename from csdb/collection/629.dat
rename to collection/629.dat
diff --git a/csdb/collection/630.dat b/collection/630.dat
similarity index 100%
rename from csdb/collection/630.dat
rename to collection/630.dat
diff --git a/csdb/collection/631.dat b/collection/631.dat
similarity index 100%
rename from csdb/collection/631.dat
rename to collection/631.dat
diff --git a/csdb/collection/632.dat b/collection/632.dat
similarity index 100%
rename from csdb/collection/632.dat
rename to collection/632.dat
diff --git a/collection/633.dat b/collection/633.dat
new file mode 100644
index 0000000..fc857f4
--- /dev/null
+++ b/collection/633.dat
@@ -0,0 +1,21 @@
+function PowN(const X: Extended; const N: Integer): Extended;
+var
+ I: Integer;
+begin
+ if N = 0 then
+ // IEEE: pown(x, 0) is 1, even when X is zero
+ Exit(1.0);
+ if Math.SameValue(1.0, X) then
+ Exit(1.0);
+ if Math.IsZero(X) then
+ begin
+ if N < 0 then
+ raise SysUtils.EDivByZero.Create('PowN: Negative exponent for X = 0');
+ Exit(0.0);
+ end;
+ Result := 1.0;
+ for I := 1 to System.Abs(N) do
+ Result := Result * X;
+ if N < 0 then
+ Result := 1 / Result;
+end;
\ No newline at end of file
diff --git a/collection/634.dat b/collection/634.dat
new file mode 100644
index 0000000..ce9318e
--- /dev/null
+++ b/collection/634.dat
@@ -0,0 +1,22 @@
+function PowNZN(const X: Integer; const N: Cardinal): Int64;
+var
+ I: Integer;
+ OverflowGuard: Int64;
+begin
+ if N = 0 then
+ // IEEE: pown(x, 0) is 1, even when X is zero
+ Exit(1);
+ if X = 0 then
+ // pown(0, n) = 0, for all positive n
+ Exit(0);
+ OverflowGuard := High(Int64) div Abs(X);
+ Result := 1;
+ for I := 1 to N do
+ begin
+ if OverflowGuard < Abs(Result) then
+ raise SysUtils.EOverflow.CreateFmt(
+ 'Overflow calculating %d to the power %d', [X, N]
+ );
+ Result := Result * X;
+ end;
+end;
\ No newline at end of file
diff --git a/collection/635.dat b/collection/635.dat
new file mode 100644
index 0000000..7ffe94e
--- /dev/null
+++ b/collection/635.dat
@@ -0,0 +1,23 @@
+function PowNZZ(const X: Integer; const N: Integer): Extended;
+var
+ I: Integer;
+ ResultInt: Int64;
+begin
+ if N = 0 then
+ Exit(1.0);
+ if X = 1 then
+ Exit(1.0);
+ if X = 0 then
+ begin
+ if N < 0 then
+ raise SysUtils.EDivByZero.Create('PowNZZ: Negative exponent for X = 0');
+ Exit(0.0);
+ end;
+ ResultInt := 1;
+ for I := 1 to System.Abs(N) do
+ ResultInt := ResultInt * X;
+ if N > 0 then
+ Result := ResultInt
+ else // N < 0
+ Result := 1 / ResultInt;
+end;
\ No newline at end of file
diff --git a/collection/636.dat b/collection/636.dat
new file mode 100644
index 0000000..517eb8e
--- /dev/null
+++ b/collection/636.dat
@@ -0,0 +1,8 @@
+function ArraySum(const A: array of Cardinal): Cardinal; overload;
+var
+ Elem: Cardinal;
+begin
+ Result := 0;
+ for Elem in A do
+ Result := Result + Elem;
+end;
\ No newline at end of file
diff --git a/collection/637.dat b/collection/637.dat
new file mode 100644
index 0000000..71e899f
--- /dev/null
+++ b/collection/637.dat
@@ -0,0 +1,8 @@
+function ArraySum(const A: array of Double): Double; overload;
+var
+ Elem: Double;
+begin
+ Result := 0.0;
+ for Elem in A do
+ Result := Result + Elem;
+end;
\ No newline at end of file
diff --git a/collection/638.dat b/collection/638.dat
new file mode 100644
index 0000000..1d8dd8e
--- /dev/null
+++ b/collection/638.dat
@@ -0,0 +1,8 @@
+function ArraySum(const A: array of Extended): Extended; overload;
+var
+ Elem: Extended;
+begin
+ Result := 0.0;
+ for Elem in A do
+ Result := Result + Elem;
+end;
\ No newline at end of file
diff --git a/collection/639.dat b/collection/639.dat
new file mode 100644
index 0000000..d9d5b46
--- /dev/null
+++ b/collection/639.dat
@@ -0,0 +1,8 @@
+function ArraySum(const A: array of Int64): Int64; overload;
+var
+ Elem: Int64;
+begin
+ Result := 0;
+ for Elem in A do
+ Result := Result + Elem;
+end;
\ No newline at end of file
diff --git a/collection/640.dat b/collection/640.dat
new file mode 100644
index 0000000..0da5f31
--- /dev/null
+++ b/collection/640.dat
@@ -0,0 +1,8 @@
+function ArraySum(const A: array of Integer): Integer; overload;
+var
+ Elem: Integer;
+begin
+ Result := 0;
+ for Elem in A do
+ Result := Result + Elem;
+end;
\ No newline at end of file
diff --git a/collection/641.dat b/collection/641.dat
new file mode 100644
index 0000000..6f7aec8
--- /dev/null
+++ b/collection/641.dat
@@ -0,0 +1,8 @@
+function ArraySum(const A: array of Single): Single; overload;
+var
+ Elem: Single;
+begin
+ Result := 0.0;
+ for Elem in A do
+ Result := Result + Elem;
+end;
\ No newline at end of file
diff --git a/collection/642.dat b/collection/642.dat
new file mode 100644
index 0000000..8a3037b
--- /dev/null
+++ b/collection/642.dat
@@ -0,0 +1,8 @@
+function ArraySum(const A: array of UInt64): UInt64; overload;
+var
+ Elem: UInt64;
+begin
+ Result := 0;
+ for Elem in A do
+ Result := Result + Elem;
+end;
\ No newline at end of file
diff --git a/collection/643.dat b/collection/643.dat
new file mode 100644
index 0000000..e33e9f5
--- /dev/null
+++ b/collection/643.dat
@@ -0,0 +1,18 @@
+function SumOfLogs(const A: array of Cardinal): Extended; overload;
+{$IFDEF FPC}
+const
+{$ELSE}
+resourcestring
+{$ENDIF}
+ sNotPositive = 'All elements of array A must be > 0';
+var
+ Elem: Cardinal;
+begin
+ Result := 0.0;
+ for Elem in A do
+ begin
+ if Elem = 0 then
+ raise SysUtils.EArgumentOutOfRangeException.Create(sNotPositive);
+ Result := Result + System.Ln(Elem);
+ end;
+end;
\ No newline at end of file
diff --git a/collection/644.dat b/collection/644.dat
new file mode 100644
index 0000000..100fab3
--- /dev/null
+++ b/collection/644.dat
@@ -0,0 +1,18 @@
+function SumOfLogs(const A: array of Int64): Extended; overload;
+{$IFDEF FPC}
+const
+{$ELSE}
+resourcestring
+{$ENDIF}
+ sNotPositive = 'All elements of array A must be > 0';
+var
+ Elem: Int64;
+begin
+ Result := 0.0;
+ for Elem in A do
+ begin
+ if Elem <= 0 then
+ raise SysUtils.EArgumentOutOfRangeException.Create(sNotPositive);
+ Result := Result + System.Ln(Elem);
+ end;
+end;
\ No newline at end of file
diff --git a/collection/645.dat b/collection/645.dat
new file mode 100644
index 0000000..a9bc48d
--- /dev/null
+++ b/collection/645.dat
@@ -0,0 +1,18 @@
+function SumOfLogs(const A: array of Integer): Extended; overload;
+{$IFDEF FPC}
+const
+{$ELSE}
+resourcestring
+{$ENDIF}
+ sNotPositive = 'All elements of array A must be > 0';
+var
+ Elem: Integer;
+begin
+ Result := 0.0;
+ for Elem in A do
+ begin
+ if Elem <= 0 then
+ raise SysUtils.EArgumentOutOfRangeException.Create(sNotPositive);
+ Result := Result + System.Ln(Elem);
+ end;
+end;
\ No newline at end of file
diff --git a/collection/646.dat b/collection/646.dat
new file mode 100644
index 0000000..0576362
--- /dev/null
+++ b/collection/646.dat
@@ -0,0 +1,18 @@
+function SumOfLogs(const A: array of UInt64): Extended; overload;
+{$IFDEF FPC}
+const
+{$ELSE}
+resourcestring
+{$ENDIF}
+ sNotPositive = 'All elements of array A must be > 0';
+var
+ Elem: UInt64;
+begin
+ Result := 0.0;
+ for Elem in A do
+ begin
+ if Elem = 0 then
+ raise SysUtils.EArgumentOutOfRangeException.Create(sNotPositive);
+ Result := Result + System.Ln(Elem);
+ end;
+end;
\ No newline at end of file
diff --git a/collection/647.dat b/collection/647.dat
new file mode 100644
index 0000000..e9a4939
--- /dev/null
+++ b/collection/647.dat
@@ -0,0 +1,18 @@
+function SumOfLogs(const A: array of Double): Double; overload;
+{$IFDEF FPC}
+const
+{$ELSE}
+resourcestring
+{$ENDIF}
+ sNotPositive = 'All elements of array A must be > 0';
+var
+ Elem: Double;
+begin
+ Result := 0.0;
+ for Elem in A do
+ begin
+ if Math.Sign(Elem) <> Math.PositiveValue then
+ raise SysUtils.EArgumentOutOfRangeException.Create(sNotPositive);
+ Result := Result + System.Ln(Elem);
+ end;
+end;
\ No newline at end of file
diff --git a/collection/648.dat b/collection/648.dat
new file mode 100644
index 0000000..e16d1bc
--- /dev/null
+++ b/collection/648.dat
@@ -0,0 +1,18 @@
+function SumOfLogs(const A: array of Extended): Extended; overload;
+{$IFDEF FPC}
+const
+{$ELSE}
+resourcestring
+{$ENDIF}
+ sNotPositive = 'All elements of array A must be > 0';
+var
+ Elem: Extended;
+begin
+ Result := 0.0;
+ for Elem in A do
+ begin
+ if Math.Sign(Elem) <> Math.PositiveValue then
+ raise SysUtils.EArgumentOutOfRangeException.Create(sNotPositive);
+ Result := Result + System.Ln(Elem);
+ end;
+end;
\ No newline at end of file
diff --git a/collection/649.dat b/collection/649.dat
new file mode 100644
index 0000000..abeaeed
--- /dev/null
+++ b/collection/649.dat
@@ -0,0 +1,18 @@
+function SumOfLogs(const A: array of Single): Single; overload;
+{$IFDEF FPC}
+const
+{$ELSE}
+resourcestring
+{$ENDIF}
+ sNotPositive = 'All elements of array A must be > 0';
+var
+ Elem: Single;
+begin
+ Result := 0.0;
+ for Elem in A do
+ begin
+ if Math.Sign(Elem) <> Math.PositiveValue then
+ raise SysUtils.EArgumentOutOfRangeException.Create(sNotPositive);
+ Result := Result + System.Ln(Elem);
+ end;
+end;
\ No newline at end of file
diff --git a/collection/650.dat b/collection/650.dat
new file mode 100644
index 0000000..20f7cd9
--- /dev/null
+++ b/collection/650.dat
@@ -0,0 +1,10 @@
+function ArithmeticMean(const A: array of Double): Double; overload;
+var
+ X: Double;
+begin
+ if Length(A) = 0 then
+ raise SysUtils.EArgumentException.Create('Array is empty');
+ Result := 0.0;
+ for X in A do
+ Result := Result + X / Length(A);
+end;
\ No newline at end of file
diff --git a/collection/651.dat b/collection/651.dat
new file mode 100644
index 0000000..8bb8c65
--- /dev/null
+++ b/collection/651.dat
@@ -0,0 +1,10 @@
+function ArithmeticMean(const A: array of Integer): Double; overload;
+var
+ X: Integer;
+begin
+ if Length(A) = 0 then
+ raise SysUtils.EArgumentException.Create('Array is empty');
+ Result := 0.0;
+ for X in A do
+ Result := Result + X / Length(A);
+end;
\ No newline at end of file
diff --git a/collection/652.dat b/collection/652.dat
new file mode 100644
index 0000000..61510f6
--- /dev/null
+++ b/collection/652.dat
@@ -0,0 +1,10 @@
+function ArithmeticMean(const A: array of Cardinal): Double; overload;
+var
+ X: Cardinal;
+begin
+ if Length(A) = 0 then
+ raise SysUtils.EArgumentException.Create('Array is empty');
+ Result := 0.0;
+ for X in A do
+ Result := Result + X / Length(A);
+end;
\ No newline at end of file
diff --git a/collection/653.dat b/collection/653.dat
new file mode 100644
index 0000000..37ff1fe
--- /dev/null
+++ b/collection/653.dat
@@ -0,0 +1,26 @@
+function WeightedArithmeticMean(const Values: array of Double;
+ const Weights: array of Double): Double; overload;
+var
+ WeightSum: Double;
+ Weight: Double;
+ Idx: Integer;
+begin
+ if Length(Values) = 0 then
+ raise SysUtils.EArgumentException.Create('Array of values is empty');
+ if Length(Values) <> Length(Weights) then
+ raise SysUtils.EArgumentException.Create(
+ 'Number of values and number of weights must be the same'
+ );
+ WeightSum := 0.0;
+ for Weight in Weights do
+ begin
+ if Math.Sign(Weight) = Math.NegativeValue then
+ raise SysUtils.EArgumentException.Create('Weights must all be >= 0');
+ WeightSum := WeightSum + Weight;
+ end;
+ if Math.IsZero(WeightSum) then
+ raise SysUtils.EArgumentException.Create('All weights are 0');
+ Result := 0.0;
+ for Idx := Low(Values) to High(Values) do
+ Result := Result + Weights[Idx] * Values[Idx] / WeightSum;
+end;
\ No newline at end of file
diff --git a/collection/654.dat b/collection/654.dat
new file mode 100644
index 0000000..159f3e3
--- /dev/null
+++ b/collection/654.dat
@@ -0,0 +1,11 @@
+function WeightedArithmeticMean(const Values: array of Integer;
+ const Weights: array of Double): Double; overload;
+var
+ Idx: Integer;
+ DblVals: array of Double;
+begin
+ SetLength(DblVals, Length(Values));
+ for Idx := Low(Values) to High(Values) do
+ DblVals[Idx] := Values[Idx];
+ Result := WeightedArithmeticMean(DblVals, Weights);
+end;
\ No newline at end of file
diff --git a/collection/655.dat b/collection/655.dat
new file mode 100644
index 0000000..0ec71c1
--- /dev/null
+++ b/collection/655.dat
@@ -0,0 +1,11 @@
+function WeightedArithmeticMean(const Values: array of Cardinal;
+ const Weights: array of Double): Double; overload;
+var
+ Idx: Integer;
+ DblVals: array of Double;
+begin
+ SetLength(DblVals, Length(Values));
+ for Idx := Low(Values) to High(Values) do
+ DblVals[Idx] := Values[Idx];
+ Result := WeightedArithmeticMean(DblVals, Weights);
+end;
\ No newline at end of file
diff --git a/collection/656.dat b/collection/656.dat
new file mode 100644
index 0000000..09dac28
--- /dev/null
+++ b/collection/656.dat
@@ -0,0 +1,8 @@
+function ReverseByteArray(const A: array of Byte): TBytes;
+var
+ I: Integer;
+begin
+ SetLength(Result, Length(A));
+ for I := 0 to High(A) do
+ Result[High(A)-I] := A[I];
+end;
\ No newline at end of file
diff --git a/collection/657.dat b/collection/657.dat
new file mode 100644
index 0000000..ab80b9a
--- /dev/null
+++ b/collection/657.dat
@@ -0,0 +1,20 @@
+function DigitSumBase(N: Int64; const Base: Byte): Integer;
+var
+ SignOfN: Math.TValueSign;
+begin
+ if Base < 2 then
+ raise SysUtils.EArgumentException.Create(
+ 'Base must be in the range 2..255'
+ );
+ if N = 0 then
+ Exit(0);
+ SignOfN := Math.Sign(N);
+ N := Abs(N);
+ Result := 0;
+ repeat
+ Inc(Result, N mod Base);
+ N := N div Base;
+ until N = 0;
+ if SignOfN = Math.NegativeValue then
+ Result := -1 * Result;
+end;
\ No newline at end of file
diff --git a/collection/658.dat b/collection/658.dat
new file mode 100644
index 0000000..4249468
--- /dev/null
+++ b/collection/658.dat
@@ -0,0 +1,15 @@
+function DigitCountBase(N: Int64; const Base: Byte): Cardinal;
+begin
+ if Base < 2 then
+ raise SysUtils.EArgumentException.Create(
+ 'Base must be in the range 2..255'
+ );
+ if N = 0 then
+ Exit(1);
+ N := Abs(N);
+ Result := 0;
+ repeat
+ Inc(Result);
+ N := N div Base;
+ until N = 0;
+end;
\ No newline at end of file
diff --git a/collection/659.dat b/collection/659.dat
new file mode 100644
index 0000000..0315804
--- /dev/null
+++ b/collection/659.dat
@@ -0,0 +1,22 @@
+function DigitsOf(N: Int64; const Base: Byte): SysUtils.TBytes;
+var
+ Idx: Integer;
+begin
+ if Base < 2 then
+ raise SysUtils.EArgumentException.Create(
+ 'Base must be in the range 2..255'
+ );
+ N := Abs(N);
+ SetLength(Result, DigitCountBase(N, Base));
+ if N > 0 then
+ begin
+ Idx := 0;
+ repeat
+ Result[Idx] := N mod Base;
+ Inc(Idx);
+ N := N div Base;
+ until N = 0;
+ end
+ else
+ Result[0] := 0;
+end;
\ No newline at end of file
diff --git a/collection/660.dat b/collection/660.dat
new file mode 100644
index 0000000..bd52445
--- /dev/null
+++ b/collection/660.dat
@@ -0,0 +1,13 @@
+function IsPalindromic(const N: Int64; const Base: Byte = 10): Boolean;
+var
+ Digits: SysUtils.TBytes;
+ Idx: Integer;
+ PartitionSize: Integer;
+begin
+ Digits := DigitsOf(N, Base); // raises exception for Base < 2
+ Result := True;
+ PartitionSize := Length(Digits) div 2;
+ for Idx := 0 to Pred(PartitionSize) do
+ if Digits[Idx] <> Digits[Length(Digits) - Idx - 1] then
+ Exit(False);
+end;
\ No newline at end of file
diff --git a/collection/661.dat b/collection/661.dat
new file mode 100644
index 0000000..043328e
--- /dev/null
+++ b/collection/661.dat
@@ -0,0 +1,27 @@
+function DigitPowerSum(N: Integer; const Base: Byte; const Exponent: Byte):
+ Int64;
+var
+ SignOfN: Math.TValueSign;
+ Digit: Integer;
+ PowerDigit: Int64;
+begin
+ if Base < 2 then
+ raise SysUtils.EArgumentException.Create(
+ 'Base must be in the range 2..255'
+ );
+ if N = 0 then
+ Exit(0);
+ SignOfN := Math.Sign(N);
+ N := Abs(N);
+ Result := 0;
+ repeat
+ Digit := N mod Base;
+ PowerDigit := PowNZN(Digit, Exponent);
+ if High(Int64) - PowerDigit < Abs(Result) then
+ raise SysUtils.EOverflow.Create('Overflow calculating digit power sum');
+ Result := Result + PowerDigit;
+ N := N div Base;
+ until N = 0;
+ if SignOfN = Math.NegativeValue then
+ Result := -1 * Result;
+end;
\ No newline at end of file
diff --git a/collection/662.dat b/collection/662.dat
new file mode 100644
index 0000000..107ce9e
--- /dev/null
+++ b/collection/662.dat
@@ -0,0 +1,8 @@
+function IsNarcissistic(N: Integer; const Base: Byte = 10): Boolean;
+var
+ Sum: Int64;
+begin
+ N := Abs(N);
+ Sum := DigitPowerSum(N, Base, DigitCountBase(N, Base));
+ Result := N = Sum;
+end;
\ No newline at end of file
diff --git a/collection/663.dat b/collection/663.dat
new file mode 100644
index 0000000..fa0208b
--- /dev/null
+++ b/collection/663.dat
@@ -0,0 +1,15 @@
+function LSE(const A: array of Double): Double;
+var
+ MaxElem: Double;
+ Elem: Double;
+ Sum: Double;
+begin
+ if System.Length(A) = 0 then
+ raise SysUtils.EArgumentException.Create('Empty array');
+ // Using the centering "trick": see https://rpubs.com/FJRubio/LSE
+ MaxElem := MaxOfArray(A);
+ Sum := 0.0;
+ for Elem in A do
+ Sum := Sum + System.Exp(Elem - MaxElem);
+ Result := System.Ln(Sum) + MaxElem;
+end;
\ No newline at end of file
diff --git a/collection/664.dat b/collection/664.dat
new file mode 100644
index 0000000..5977f77
--- /dev/null
+++ b/collection/664.dat
@@ -0,0 +1,10 @@
+function SoftMax(const A: array of Double): Types.TDoubleDynArray;
+var
+ LSEOfA: Double;
+ Idx: Integer;
+begin
+ LSEOfA := LSE(A); // raise EArgumentException if A is empty
+ System.SetLength(Result, System.Length(A));
+ for Idx := 0 to Pred(System.Length(A)) do
+ Result[Idx] := System.Exp(A[Idx] - LSEOfA);
+end;
\ No newline at end of file
diff --git a/collection/665.dat b/collection/665.dat
new file mode 100644
index 0000000..d977091
--- /dev/null
+++ b/collection/665.dat
@@ -0,0 +1,18 @@
+function Median(A: array of Double): Double; overload;
+var
+ MiddleLo: Integer;
+begin
+ if System.Length(A) = 0 then
+ raise SysUtils.EArgumentException.Create('Array is empty');
+ // optimisations for array lengths 1 & 2 to avoid sorting
+ if System.Length(A) = 1 then
+ Exit(A[0]);
+ if System.Length(A) = 2 then
+ Exit((A[0] + A[1]) / 2.0);
+ Generics.Collections.TArray.Sort(A); // using standard comparer
+ MiddleLo := System.Length(A) div 2 - 1;
+ if System.Odd(System.Length(A)) then
+ Result := A[MiddleLo + 1]
+ else
+ Result := (A[MiddleLo] + A[MiddleLo + 1]) / 2.0;
+end;
\ No newline at end of file
diff --git a/collection/666.dat b/collection/666.dat
new file mode 100644
index 0000000..7ad2653
--- /dev/null
+++ b/collection/666.dat
@@ -0,0 +1,18 @@
+function Median(A: array of Integer): Double; overload;
+var
+ MiddleLo: Integer;
+begin
+ if System.Length(A) = 0 then
+ raise SysUtils.EArgumentException.Create('Array is empty');
+ // optimisations for array lengths 1 & 2 to avoid sorting
+ if System.Length(A) = 1 then
+ Exit(A[0]);
+ if System.Length(A) = 2 then
+ Exit((A[0] + A[1]) / 2);
+ Generics.Collections.TArray.Sort(A); // using standard comparer
+ MiddleLo := System.Length(A) div 2 - 1;
+ if System.Odd(Length(A)) then
+ Result := A[MiddleLo + 1]
+ else
+ Result := (A[MiddleLo] + A[MiddleLo + 1]) / 2;
+end;
\ No newline at end of file
diff --git a/collection/667.dat b/collection/667.dat
new file mode 100644
index 0000000..f0eedd9
--- /dev/null
+++ b/collection/667.dat
@@ -0,0 +1,14 @@
+function RescaleRange(const A: array of Double): Types.TDoubleDynArray;
+ overload;
+var
+ Min, Max, RangeLength: Double;
+ Idx: Integer;
+begin
+ MinMaxOfArray(A, Min, Max); // raises exception if A is empty
+ if Math.SameValue(Max, Min) then
+ raise SysUtils.EArgumentException.Create('All array values are the same');
+ System.SetLength(Result, System.Length(A));
+ RangeLength := Max - Min;
+ for Idx := 0 to Pred(System.Length(A)) do
+ Result[Idx] := (A[Idx] - Min) / RangeLength;
+end;
\ No newline at end of file
diff --git a/collection/668.dat b/collection/668.dat
new file mode 100644
index 0000000..49e48e4
--- /dev/null
+++ b/collection/668.dat
@@ -0,0 +1,24 @@
+function NormaliseByWeight(const A: array of Double): Types.TDoubleDynArray;
+ overload;
+var
+ Weight: Double;
+ WeightSum: Double;
+ Idx: Integer;
+begin
+ if (System.Length(A) = 0) then
+ raise SysUtils.EArgumentException.Create('Array of weights is empty');
+ WeightSum := 0.0;
+ for Weight in A do
+ begin
+ if Math.Sign(Weight) = Math.NegativeValue then
+ raise SysUtils.EArgumentException.Create(
+ 'All weights must be non-negative'
+ );
+ WeightSum := WeightSum + Weight;
+ end;
+ if Math.IsZero(WeightSum) then
+ raise SysUtils.EArgumentException.Create('Sum of weights is zero');
+ System.SetLength(Result, System.Length(A));
+ for Idx := 0 to Pred(System.Length(A)) do
+ Result[Idx] := A[Idx] / WeightSum;
+end;
\ No newline at end of file
diff --git a/collection/669.dat b/collection/669.dat
new file mode 100644
index 0000000..77c283b
--- /dev/null
+++ b/collection/669.dat
@@ -0,0 +1,19 @@
+procedure MinMaxOfArray(const A: array of Double;
+ out MinValue, MaxValue: Double); overload;
+var
+ Idx: Integer;
+ Elem: Double;
+begin
+ if Length(A) = 0 then
+ raise SysUtils.EArgumentException.Create('Array is empty');
+ MinValue := A[0];
+ MaxValue := A[0];
+ for Idx := 1 to Pred(Length(A)) do
+ begin
+ Elem := A[Idx];
+ if Elem > MaxValue then
+ MaxValue := Elem
+ else if Elem < MinValue then
+ MinValue := Elem;
+ end;
+end;
\ No newline at end of file
diff --git a/collection/670.dat b/collection/670.dat
new file mode 100644
index 0000000..ac4dba9
--- /dev/null
+++ b/collection/670.dat
@@ -0,0 +1,19 @@
+procedure MinMaxOfArray(const A: array of Integer;
+ out MinValue, MaxValue: Integer); overload;
+var
+ Idx: Integer;
+ Elem: Integer;
+begin
+ if Length(A) = 0 then
+ raise SysUtils.EArgumentException.Create('Array is empty');
+ MinValue := A[0];
+ MaxValue := A[0];
+ for Idx := 1 to Pred(Length(A)) do
+ begin
+ Elem := A[Idx];
+ if Elem > MaxValue then
+ MaxValue := Elem
+ else if Elem < MinValue then
+ MinValue := Elem;
+ end;
+end;
\ No newline at end of file
diff --git a/collection/671.dat b/collection/671.dat
new file mode 100644
index 0000000..1f9bfd5
--- /dev/null
+++ b/collection/671.dat
@@ -0,0 +1,18 @@
+function NormaliseByWeight(const A: array of Cardinal): Types.TDoubleDynArray;
+ overload;
+var
+ Weight: Cardinal;
+ WeightSum: UInt64;
+ Idx: Integer;
+begin
+ if (System.Length(A) = 0) then
+ raise SysUtils.EArgumentException.Create('Array of weights is empty');
+ WeightSum := 0;
+ for Weight in A do
+ WeightSum := WeightSum + Weight;
+ if WeightSum = 0 then
+ raise SysUtils.EArgumentException.Create('Sum of weights is zero');
+ System.SetLength(Result, System.Length(A));
+ for Idx := 0 to Pred(System.Length(A)) do
+ Result[Idx] := A[Idx] / WeightSum;
+end;
\ No newline at end of file
diff --git a/collection/672.dat b/collection/672.dat
new file mode 100644
index 0000000..5efe9b6
--- /dev/null
+++ b/collection/672.dat
@@ -0,0 +1,10 @@
+function RangeOf(const A: array of Double): Double; overload;
+var
+ MinValue, MaxValue: Double;
+begin
+ MinMaxOfArray(A, MinValue, MaxValue); // exception raised if A is empty
+ Result := MaxValue - MinValue;
+ // Ensure that exactly zero is returned when MaxValue = MinValue
+ if Math.IsZero(Result) then
+ Result := 0.0;
+end;
\ No newline at end of file
diff --git a/collection/673.dat b/collection/673.dat
new file mode 100644
index 0000000..4567410
--- /dev/null
+++ b/collection/673.dat
@@ -0,0 +1,8 @@
+function RangeOf(const A: array of Integer): Cardinal; overload;
+var
+ MinValue, MaxValue: Integer;
+begin
+ MinMaxOfArray(A, MinValue, MaxValue); // exception raised if A is empty
+ // MaxValue >= MinValue is guaranteed => Result >= 0
+ Result := Cardinal(MaxValue - MinValue);
+end;
\ No newline at end of file
diff --git a/collection/674.dat b/collection/674.dat
new file mode 100644
index 0000000..022cc24
--- /dev/null
+++ b/collection/674.dat
@@ -0,0 +1,14 @@
+function RescaleRange(const A: array of Integer): Types.TDoubleDynArray;
+ overload;
+var
+ Min, Max, RangeLength: Integer;
+ Idx: Integer;
+begin
+ MinMaxOfArray(A, Min, Max); // raises exception if A is empty
+ if Max = Min then
+ raise SysUtils.EArgumentException.Create('All array values are the same');
+ System.SetLength(Result, System.Length(A));
+ RangeLength := Max - Min;
+ for Idx := 0 to Pred(System.Length(A)) do
+ Result[Idx] := (A[Idx] - Min) / RangeLength;
+end;
\ No newline at end of file
diff --git a/collection/675.dat b/collection/675.dat
new file mode 100644
index 0000000..a2d40a1
--- /dev/null
+++ b/collection/675.dat
@@ -0,0 +1,6 @@
+function GeometricMean(const A: array of Double): Double; overload;
+begin
+ if System.Length(A) = 0 then
+ raise SysUtils.EArgumentException.Create('Array is empty');
+ Result := System.Exp(SumOfLogs(A) / System.Length(A));
+end;
\ No newline at end of file
diff --git a/collection/676.dat b/collection/676.dat
new file mode 100644
index 0000000..74b55ca
--- /dev/null
+++ b/collection/676.dat
@@ -0,0 +1,6 @@
+function GeometricMean(const A: array of Cardinal): Double; overload;
+begin
+ if System.Length(A) = 0 then
+ raise SysUtils.EArgumentException.Create('Array is empty');
+ Result := System.Exp(SumOfLogs(A) / System.Length(A));
+end;
\ No newline at end of file
diff --git a/collection/677.dat b/collection/677.dat
new file mode 100644
index 0000000..bca1225
--- /dev/null
+++ b/collection/677.dat
@@ -0,0 +1,6 @@
+function GeometricMean(const A: array of Integer): Double; overload;
+begin
+ if System.Length(A) = 0 then
+ raise SysUtils.EArgumentException.Create('Array is empty');
+ Result := System.Exp(SumOfLogs(A) / System.Length(A));
+end;
\ No newline at end of file
diff --git a/collection/678.dat b/collection/678.dat
new file mode 100644
index 0000000..76c0424
--- /dev/null
+++ b/collection/678.dat
@@ -0,0 +1,19 @@
+function WeightedGeometricMean(const Values: array of Double;
+ const Weights: array of Double): Double; overload;
+var
+ Sum: Double;
+ Idx: Integer;
+ NormalisedWeights: Types.TDoubleDynArray;
+begin
+ if System.Length(Values) = 0 then
+ raise SysUtils.EArgumentException.Create('Array of values is empty');
+ if System.Length(Values) <> System.Length(Weights) then
+ raise SysUtils.EArgumentException.Create(
+ 'Number of values and number of weights must be the same'
+ );
+ NormalisedWeights := NormaliseByWeight(Weights);
+ Sum := 0.0;
+ for Idx := 0 to Pred(System.Length(Values)) do
+ Sum := Sum + NormalisedWeights[Idx] * System.Ln(Values[Idx]);
+ Result := System.Exp(Sum);
+end;
\ No newline at end of file
diff --git a/collection/679.dat b/collection/679.dat
new file mode 100644
index 0000000..73ae5a8
--- /dev/null
+++ b/collection/679.dat
@@ -0,0 +1,11 @@
+function WeightedGeometricMean(const Values: array of Cardinal;
+ const Weights: array of Double): Double; overload;
+var
+ Idx: Integer;
+ FloatValues: Types.TDoubleDynArray;
+begin
+ System.Setlength(FloatValues, System.Length(Values));
+ for Idx := 0 to Pred(System.Length(Values)) do
+ FloatValues[Idx] := Values[Idx];
+ Result := WeightedGeometricMean(FloatValues, Weights);
+end;
\ No newline at end of file
diff --git a/collection/680.dat b/collection/680.dat
new file mode 100644
index 0000000..cea93b8
--- /dev/null
+++ b/collection/680.dat
@@ -0,0 +1,11 @@
+function WeightedGeometricMean(const Values: array of Integer;
+ const Weights: array of Double): Double; overload;
+var
+ Idx: Integer;
+ FloatValues: Types.TDoubleDynArray;
+begin
+ System.Setlength(FloatValues, System.Length(Values));
+ for Idx := 0 to Pred(System.Length(Values)) do
+ FloatValues[Idx] := Values[Idx];
+ Result := WeightedGeometricMean(FloatValues, Weights);
+end;
\ No newline at end of file
diff --git a/collection/681.dat b/collection/681.dat
new file mode 100644
index 0000000..0858379
--- /dev/null
+++ b/collection/681.dat
@@ -0,0 +1,14 @@
+function SumOfReciprocals(const A: array of Double): Double; overload;
+var
+ Elem: Double;
+begin
+ if System.Length(A) = 0 then
+ raise SysUtils.EArgumentException.Create('Array is empty');
+ Result := 0.0;
+ for Elem in A do
+ begin
+ if Math.Sign(Elem) <> Math.PositiveValue then
+ raise SysUtils.EArgumentException.Create('Array values must be > 0');
+ Result := Result + 1 / Elem;
+ end;
+end;
\ No newline at end of file
diff --git a/collection/682.dat b/collection/682.dat
new file mode 100644
index 0000000..d54aa58
--- /dev/null
+++ b/collection/682.dat
@@ -0,0 +1,14 @@
+function SumOfReciprocals(const A: array of Integer): Double; overload;
+var
+ Elem: Integer;
+begin
+ if System.Length(A) = 0 then
+ raise SysUtils.EArgumentException.Create('Array is empty');
+ Result := 0.0;
+ for Elem in A do
+ begin
+ if Elem <= 0 then
+ raise SysUtils.EArgumentException.Create('Array values must be > 0');
+ Result := Result + 1 / Elem;
+ end;
+end;
\ No newline at end of file
diff --git a/collection/683.dat b/collection/683.dat
new file mode 100644
index 0000000..1aecf6f
--- /dev/null
+++ b/collection/683.dat
@@ -0,0 +1,14 @@
+function SumOfReciprocals(const A: array of Cardinal): Double; overload;
+var
+ Elem: Cardinal;
+begin
+ if System.Length(A) = 0 then
+ raise SysUtils.EArgumentException.Create('Array is empty');
+ Result := 0.0;
+ for Elem in A do
+ begin
+ if Elem = 0 then
+ raise SysUtils.EArgumentException.Create('Array values must be > 0');
+ Result := Result + 1 / Elem;
+ end;
+end;
\ No newline at end of file
diff --git a/collection/684.dat b/collection/684.dat
new file mode 100644
index 0000000..65d6bac
--- /dev/null
+++ b/collection/684.dat
@@ -0,0 +1,4 @@
+function HarmonicMean(const A: array of Double): Double; overload;
+begin
+ Result := System.Length(A) / SumOfReciprocals(A);
+end;
\ No newline at end of file
diff --git a/collection/685.dat b/collection/685.dat
new file mode 100644
index 0000000..80fa17e
--- /dev/null
+++ b/collection/685.dat
@@ -0,0 +1,4 @@
+function HarmonicMean(const A: array of Cardinal): Double; overload;
+begin
+ Result := System.Length(A) / SumOfReciprocals(A);
+end;
\ No newline at end of file
diff --git a/collection/686.dat b/collection/686.dat
new file mode 100644
index 0000000..7928fbd
--- /dev/null
+++ b/collection/686.dat
@@ -0,0 +1,4 @@
+function HarmonicMean(const A: array of Integer): Double; overload;
+begin
+ Result := System.Length(A) / SumOfReciprocals(A);
+end;
\ No newline at end of file
diff --git a/collection/687.dat b/collection/687.dat
new file mode 100644
index 0000000..1e67aec
--- /dev/null
+++ b/collection/687.dat
@@ -0,0 +1,19 @@
+function WeightedHarmonicMean(const Values: array of Double;
+ const Weights: array of Double): Double; overload;
+var
+ Sum: Double;
+ Idx: Integer;
+ NormalisedWeights: Types.TDoubleDynArray;
+begin
+ if System.Length(Values) = 0 then
+ raise SysUtils.EArgumentException.Create('Array of values is empty');
+ if System.Length(Values) <> System.Length(Weights) then
+ raise SysUtils.EArgumentException.Create(
+ 'Number of values and number of weights must be the same'
+ );
+ NormalisedWeights := NormaliseByWeight(Weights);
+ Sum := 0.0;
+ for Idx := 0 to Pred(System.Length(Values)) do
+ Sum := Sum + NormalisedWeights[Idx] / Values[Idx];
+ Result := 1.0 / Sum;
+end;
\ No newline at end of file
diff --git a/collection/688.dat b/collection/688.dat
new file mode 100644
index 0000000..b13988d
--- /dev/null
+++ b/collection/688.dat
@@ -0,0 +1,11 @@
+function WeightedHarmonicMean(const Values: array of Cardinal;
+ const Weights: array of Double): Double; overload;
+var
+ Idx: Integer;
+ FloatValues: Types.TDoubleDynArray;
+begin
+ System.Setlength(FloatValues, System.Length(Values));
+ for Idx := 0 to Pred(System.Length(Values)) do
+ FloatValues[Idx] := Values[Idx];
+ Result := WeightedHarmonicMean(FloatValues, Weights);
+end;
\ No newline at end of file
diff --git a/collection/689.dat b/collection/689.dat
new file mode 100644
index 0000000..4c87583
--- /dev/null
+++ b/collection/689.dat
@@ -0,0 +1,11 @@
+function WeightedHarmonicMean(const Values: array of Integer;
+ const Weights: array of Double): Double; overload;
+var
+ Idx: Integer;
+ FloatValues: Types.TDoubleDynArray;
+begin
+ System.Setlength(FloatValues, System.Length(Values));
+ for Idx := 0 to Pred(System.Length(Values)) do
+ FloatValues[Idx] := Values[Idx];
+ Result := WeightedHarmonicMean(FloatValues, Weights);
+end;
\ No newline at end of file
diff --git a/collection/690.dat b/collection/690.dat
new file mode 100644
index 0000000..5a5f1db
--- /dev/null
+++ b/collection/690.dat
@@ -0,0 +1,11 @@
+function LogarithmicMean(const X, Y: Double): Double;
+begin
+ if (X <= 0) or (Y <= 0) then
+ raise SysUtils.EArgumentException.Create(
+ 'Parameters X & Y must both be positive'
+ );
+ if Math.SameValue(X, Y) then
+ Result := X
+ else
+ Result := (Y - X) / (System.Ln(Y) - System.Ln(X));
+end;
\ No newline at end of file
diff --git a/collection/691.dat b/collection/691.dat
new file mode 100644
index 0000000..03d156f
--- /dev/null
+++ b/collection/691.dat
@@ -0,0 +1,22 @@
+function PowerMean(const A: array of Double; const Lambda: Double): Double;
+ overload;
+var
+ Sum: Double;
+ X: Double;
+begin
+ if System.Length(A) = 0 then
+ raise SysUtils.EArgumentException.Create('Array is empty');
+ if Math.IsZero(Lambda) then
+ raise SysUtils.EArgumentException.Create('Lambda must not be zero');
+ Sum := 0.0;
+ for X in A do
+ begin
+ if Math.Sign(X) = NegativeValue then
+ raise SysUtils.EArgumentException.Create(
+ 'All array elements must be non-negative'
+ );
+ if not Math.IsZero(X) then
+ Sum := Sum + Math.Power(X, Lambda);
+ end;
+ Result := Math.Power(Sum / System.Length(A), 1 / Lambda);
+end;
\ No newline at end of file
diff --git a/collection/692.dat b/collection/692.dat
new file mode 100644
index 0000000..5347100
--- /dev/null
+++ b/collection/692.dat
@@ -0,0 +1,11 @@
+function PowerMean(const A: array of Integer; const Lambda: Double): Double;
+ overload;
+var
+ Floats: Types.TDoubleDynArray;
+ Idx: Integer;
+begin
+ System.SetLength(Floats, System.Length(A));
+ for Idx := 0 to Pred(System.Length(A)) do
+ Floats[Idx] := A[Idx];
+ Result := PowerMean(Floats, Lambda);
+end;
\ No newline at end of file
diff --git a/collection/693.dat b/collection/693.dat
new file mode 100644
index 0000000..74b3efa
--- /dev/null
+++ b/collection/693.dat
@@ -0,0 +1,11 @@
+function PowerMean(const A: array of Cardinal; const Lambda: Double): Double;
+ overload;
+var
+ Floats: Types.TDoubleDynArray;
+ Idx: Integer;
+begin
+ System.SetLength(Floats, System.Length(A));
+ for Idx := 0 to Pred(System.Length(A)) do
+ Floats[Idx] := A[Idx];
+ Result := PowerMean(Floats, Lambda);
+end;
\ No newline at end of file
diff --git a/collection/694.dat b/collection/694.dat
new file mode 100644
index 0000000..9f6fcb5
--- /dev/null
+++ b/collection/694.dat
@@ -0,0 +1,35 @@
+function WeightedPowerMean(const Values, Weights: array of Double;
+ const Lambda: Double): Double; overload;
+var
+ NormalisedWeights: Types.TDoubleDynArray;
+ PowerSum: Double;
+ Idx: Integer;
+ Value: Double;
+ Weight: Double;
+begin
+ if System.Length(Values) = 0 then
+ raise SysUtils.EArgumentException.Create('Array of values is empty');
+ if System.Length(Values) <> System.Length(Weights) then
+ raise SysUtils.EArgumentException.Create(
+ 'Number of values and number of weights must be the same'
+ );
+ if Math.IsZero(Lambda) then
+ raise SysUtils.EArgumentException.Create('Lambda must not be zero');
+ NormalisedWeights := NormaliseByWeight(Weights);
+ PowerSum := 0.0;
+ for Idx := 0 to Pred(System.Length(Values)) do
+ begin
+ Value := Values[Idx];
+ Weight := NormalisedWeights[Idx];
+ if Math.Sign(Value) = Math.NegativeValue then
+ raise SysUtils.EArgumentException.Create(
+ 'All values must be non-negative'
+ );
+ if not Math.IsZero(Value) and not Math.IsZero(Weight) then
+ PowerSum := PowerSum + Weight * Math.Power(Value, Lambda);
+ end;
+ if not Math.IsZero(PowerSum) then
+ Result := Math.Power(PowerSum, 1 / Lambda)
+ else
+ Result := 0.0;
+end;
\ No newline at end of file
diff --git a/collection/695.dat b/collection/695.dat
new file mode 100644
index 0000000..8977187
--- /dev/null
+++ b/collection/695.dat
@@ -0,0 +1,11 @@
+function WeightedPowerMean(const Values: array of Integer;
+ const Weights: array of Double; const Lambda: Double): Double; overload;
+var
+ FloatValues: Types.TDoubleDynArray;
+ Idx: Integer;
+begin
+ System.SetLength(FloatValues, System.Length(Values));
+ for Idx := 0 to Pred(System.Length(Values)) do
+ FloatValues[Idx] := Values[Idx];
+ Result := WeightedPowerMean(FloatValues, Weights, Lambda);
+end;
\ No newline at end of file
diff --git a/collection/696.dat b/collection/696.dat
new file mode 100644
index 0000000..3e7184b
--- /dev/null
+++ b/collection/696.dat
@@ -0,0 +1,11 @@
+function WeightedPowerMean(const Values: array of Cardinal;
+ const Weights: array of Double; const Lambda: Double): Double; overload;
+var
+ FloatValues: Types.TDoubleDynArray;
+ Idx: Integer;
+begin
+ System.SetLength(FloatValues, System.Length(Values));
+ for Idx := 0 to Pred(System.Length(Values)) do
+ FloatValues[Idx] := Values[Idx];
+ Result := WeightedPowerMean(FloatValues, Weights, Lambda);
+end;
\ No newline at end of file
diff --git a/collection/697.dat b/collection/697.dat
new file mode 100644
index 0000000..073043a
--- /dev/null
+++ b/collection/697.dat
@@ -0,0 +1,27 @@
+function Mode(const A: array of Integer): System.TArray;
+var
+ OccurrenceCounts: System.TArray>;
+ Modes: Generics.Collections.TList;
+ KV: Generics.Collections.TPair;
+ MaxCount: Cardinal;
+begin
+ if System.Length(A) <= 1 then
+ raise SysUtils.EArgumentException.Create(
+ 'At least two values required to calculate the mode'
+ );
+ MaxCount := 0;
+ OccurrenceCounts := CountOccurrences(A);
+ for KV in OccurrenceCounts do
+ if KV.Value > MaxCount then
+ MaxCount := KV.Value;
+ Modes := Generics.Collections.TList.Create;
+ try
+ for KV in OccurrenceCounts do
+ if KV.Value = MaxCount then
+ Modes.Add(KV.Key);
+ Modes.Sort;
+ Result := Modes.ToArray;
+ finally
+ Modes.Free;
+ end;
+end;
\ No newline at end of file
diff --git a/collection/698.dat b/collection/698.dat
new file mode 100644
index 0000000..2fd2baf
--- /dev/null
+++ b/collection/698.dat
@@ -0,0 +1,39 @@
+function ModeAlt(const A: array of Integer): System.TArray;
+var
+ OccurrenceCounts: System.TArray>;
+ Modes: Generics.Collections.TList;
+ KV: Generics.Collections.TPair;
+ MaxCount: Cardinal;
+ HasMode: Boolean;
+begin
+ if System.Length(A) <= 1 then
+ raise SysUtils.EArgumentException.Create(
+ 'At least two values required to calculate the mode'
+ );
+ OccurrenceCounts := CountOccurrences(A);
+ if System.Length(OccurrenceCounts) = 1 then
+ // all data items have the same value: result is the sole data value
+ Exit(System.TArray.Create(A[0]));
+ MaxCount := 0;
+ for KV in OccurrenceCounts do
+ if KV.Value > MaxCount then
+ MaxCount := KV.Value;
+ Modes := Generics.Collections.TList.Create;
+ HasMode := False;
+ try
+ for KV in OccurrenceCounts do
+ if KV.Value = MaxCount then
+ Modes.Add(KV.Key)
+ else
+ HasMode := True;
+ Modes.Sort;
+ if HasMode then
+ Result := Modes.ToArray
+ else
+ // the are >= 2 different data items, all of which occur with the same
+ // frequency: return empty array
+ System.SetLength(Result, 0);
+ finally
+ Modes.Free;
+ end;
+end;
\ No newline at end of file
diff --git a/collection/699.dat b/collection/699.dat
new file mode 100644
index 0000000..dc6c7f1
--- /dev/null
+++ b/collection/699.dat
@@ -0,0 +1,48 @@
+function CountOccurrences(const A: array of Integer):
+ System.TArray>;
+var
+ OccurrenceMap: Generics.Collections.TDictionary;
+ Elem: Integer;
+ OccurrencesOfX: Cardinal;
+
+ procedure SortResult(
+ var A: array of Generics.Collections.TPair);
+ var
+ Comparer: Generics.Defaults.IComparer<
+ Generics.Collections.TPair
+ >;
+ begin
+ Comparer := Generics.Defaults.TDelegatedComparer<
+ Generics.Collections.TPair
+ >.Create(
+ function (
+ const Left, Right: Generics.Collections.TPair):
+ Integer
+ begin
+ Result := Left.Key - Right.Key;
+ end
+ );
+ Generics.Collections.TArray.Sort<
+ Generics.Collections.TPair
+ >(A, Comparer);
+ end;
+
+begin
+ if System.Length(A) = 0 then
+ raise SysUtils.EArgumentException.Create('Array is empty');
+ OccurrenceMap := Generics.Collections.TDictionary.Create;
+ try
+ for Elem in A do
+ begin
+ if OccurrenceMap.TryGetValue(Elem, OccurrencesOfX) then
+ System.Inc(OccurrencesOfX)
+ else
+ OccurrencesOfX := 1;
+ OccurrenceMap.AddOrSetValue(Elem, OccurrencesOfX);
+ end;
+ Result := OccurrenceMap.ToArray;
+ SortResult(Result);
+ finally
+ OccurrenceMap.Free;
+ end;
+end;
\ No newline at end of file
diff --git a/collection/700.dat b/collection/700.dat
new file mode 100644
index 0000000..4220d4a
--- /dev/null
+++ b/collection/700.dat
@@ -0,0 +1,29 @@
+function ModeCount(const A: array of Integer): Integer;
+var
+ OccurrenceCounts: System.TArray>;
+ KV: Generics.Collections.TPair;
+ MaxCount: Cardinal;
+ HasMode: Boolean;
+begin
+ if System.Length(A) <= 1 then
+ raise SysUtils.EArgumentException.Create(
+ 'At least two values required to calculate a mode'
+ );
+ OccurrenceCounts := CountOccurrences(A);
+ if System.Length(OccurrenceCounts) = 1 then
+ // all data items have the same value: has single mode
+ Exit(1);
+ MaxCount := 0;
+ for KV in OccurrenceCounts do
+ if KV.Value > MaxCount then
+ MaxCount := KV.Value;
+ Result := 0;
+ HasMode := False;
+ for KV in OccurrenceCounts do
+ if KV.Value = MaxCount then
+ System.Inc(Result)
+ else
+ HasMode := True;
+ if not HasMode then
+ Result := 0;
+end;
\ No newline at end of file
diff --git a/collection/701.dat b/collection/701.dat
new file mode 100644
index 0000000..f323b51
--- /dev/null
+++ b/collection/701.dat
@@ -0,0 +1,24 @@
+function HasMode(const A: array of Integer): Boolean;
+var
+ OccurrenceCounts: System.TArray>;
+ KV: Generics.Collections.TPair;
+ MaxCount: Cardinal;
+begin
+ if System.Length(A) <= 1 then
+ raise SysUtils.EArgumentException.Create(
+ 'At least two values required to calculate a mode'
+ );
+ Result := False;
+ OccurrenceCounts := CountOccurrences(A);
+ if System.Length(OccurrenceCounts) = 1 then
+ // all data items have the same value: has mode
+ Exit(True);
+ MaxCount := 0;
+ for KV in OccurrenceCounts do
+ if KV.Value > MaxCount then
+ MaxCount := KV.Value;
+ for KV in OccurrenceCounts do
+ if KV.Value < MaxCount then
+ // at least one value is not the mode => mode exists
+ Exit(True);
+end;
\ No newline at end of file
diff --git a/collection/702.dat b/collection/702.dat
new file mode 100644
index 0000000..dd5b084
--- /dev/null
+++ b/collection/702.dat
@@ -0,0 +1,11 @@
+function RMS(const A: array of Double): Double; overload;
+var
+ Squares: array of Double;
+ Idx: Integer;
+begin
+ System.SetLength(Squares, System.Length(A));
+ for Idx := 0 to Pred(System.Length(A)) do
+ Squares[Idx] := A[Idx] * A[Idx];
+ // Note: ArithmeticMean raises exception if A is empty
+ Result := Math.Power(ArithmeticMean(Squares), 0.5);
+end;
\ No newline at end of file
diff --git a/collection/703.dat b/collection/703.dat
new file mode 100644
index 0000000..ad0164b
--- /dev/null
+++ b/collection/703.dat
@@ -0,0 +1,16 @@
+function RMS(const A: array of Integer): Double; overload;
+var
+ Squares: array of Double;
+ Idx: Integer;
+ Elem: Double;
+begin
+ System.SetLength(Squares, System.Length(A));
+ for Idx := 0 to Pred(System.Length(A)) do
+ begin
+ // convert Integer to Double before squaring to reduce change of overflow
+ Elem := A[Idx];
+ Squares[Idx] := Elem * Elem;
+ end;
+ // Note: ArithmeticMean raises exception if A is empty
+ Result := Math.Power(ArithmeticMean(Squares), 0.5);
+end;
\ No newline at end of file
diff --git a/collection/704.dat b/collection/704.dat
new file mode 100644
index 0000000..1ac9bc8
--- /dev/null
+++ b/collection/704.dat
@@ -0,0 +1,11 @@
+function TSS(const A: array of Double): Double; overload;
+var
+ ElemOfA: Double;
+ MeanOfA: Double;
+begin
+ // Note: ArithmeticMean raises an exception if A is empty
+ MeanOfA := ArithmeticMean(A);
+ Result := 0.0;
+ for ElemOfA in A do
+ Result := Result + System.Sqr(ElemOfA - MeanOfA);
+end;
\ No newline at end of file
diff --git a/collection/705.dat b/collection/705.dat
new file mode 100644
index 0000000..de00999
--- /dev/null
+++ b/collection/705.dat
@@ -0,0 +1,11 @@
+function TSS(const A: array of Integer): Double; overload;
+var
+ ElemOfA: Double;
+ MeanOfA: Double;
+begin
+ // Note: ArithmeticMean raises an exception if A is empty
+ MeanOfA := ArithmeticMean(A);
+ Result := 0.0;
+ for ElemOfA in A do
+ Result := Result + System.Sqr(ElemOfA - MeanOfA);
+end;
\ No newline at end of file
diff --git a/collection/706.dat b/collection/706.dat
new file mode 100644
index 0000000..d5b92f7
--- /dev/null
+++ b/collection/706.dat
@@ -0,0 +1,261 @@
+type
+ TIntegerRange = record
+ strict private
+ var
+ fLowerBound: Integer;
+ fUpperBound: Integer;
+ function GetLowerBound: Integer;
+ function GetUpperBound: Integer;
+ function IsSubrangeOf(const ARange: TIntegerRange): Boolean;
+ public
+ // Constructs a range whose bounds are A and B. The lowest of the two
+ // parameters is taken as the lower bound of the range with the other
+ // parameter taken as the upper bound.
+ // Valid bounds must fall in the range -MaxInt..MaxInt. An
+ // EArgumentException exception is raised otherwise.
+ constructor Create(const A, B: Integer);
+
+ // Constructs an empty range.
+ class function CreateEmpty: TIntegerRange; static;
+
+ // Checks if the range is empty.
+ function IsEmpty: Boolean;
+
+ // Returns the length of the range, i.e. the number of integers in the range.
+ function Length: Cardinal;
+
+ // Constrains AValue to fall within this range. If the value lies within the
+ // range it is returned unchanged. If it is outside the range then either
+ // LowerBound or UpperBound is returned, depending on whether the value
+ // falls below or above the range, respectively.
+ // An EInvalidOpException exception is raised if the range is empty.
+ function Constrain(const AValue: Integer): Integer;
+
+ // Checks if this range overlaps with ARange, i.e. the interection of the
+ // ranges is non empty. Empty ranges cannot overlap with any range.
+ function OverlapsWith(const ARange: TIntegerRange): Boolean;
+
+ // Checks if this range is immediately adjacent to ARange, with no overlap.
+ // Empty ranges are never contiguous with other ranges or themselves.
+ function IsContiguousWith(const ARange: TIntegerRange): Boolean;
+
+ // Checks if the set of all values in this range and ARange form a
+ // continuous sequence. This implies that a range is continuous with itself.
+ // Since adding an empty range to a non-empty range doesn't change the
+ // non-empty range we define empty ranges to be continuous with any range.
+ function IsContinuousWith(const ARange: TIntegerRange): Boolean;
+
+ // Checks if ranges A and B are the same
+ class operator Equal(const A, B: TIntegerRange): Boolean;
+
+ // Checks if ranges A and B are not the same
+ class operator NotEqual(const A, B: TIntegerRange): Boolean;
+
+ // Checks if range A is contained in, or is the same as, range B.
+ // An empty range is deemed to be contained in any other range.
+ class operator LessThanOrEqual(const A, B: TIntegerRange): Boolean;
+
+ // Checks if range A is contains, or is the same as, range B.
+ // A non-empty range is never contained in an empty range.
+ class operator GreaterThanOrEqual(const A, B: TIntegerRange): Boolean;
+
+ // Combine two ranges, A and B. The result is the smallest range that
+ // contains both A and B.
+ // If A and B are not continuous the resulting range will contain values
+ // that were not in either A or B.
+ // Combining any range either with itself or with an empty range is a no-op.
+ class operator Add(const A, B: TIntegerRange): TIntegerRange;
+
+ // Returns a range that is the intersection of ranges A and B.
+ // Returns an empty range if A and B do not overlap.
+ class operator Multiply(const A, B: TIntegerRange): TIntegerRange;
+
+ // Checks if integer AValue is contained within range ARange.
+ class operator In(const AValue: Integer; const ARange: TIntegerRange):
+ Boolean;
+
+ // Implicitly casts ARange to a string. If ARange is non-empty the string
+ // has format [X..Y], where X and Y are the lower and upper bounds of
+ // ARange respectively. If ARange is empty then [] is returned.
+ // This means that ARange can be assigned directly to a string.
+ class operator Implicit(const ARange: TIntegerRange): string;
+
+ // Explicitly casts ARange to a string. If ARange is non-empty the string
+ // has format [X..Y], where X and Y are the lower and upper bounds of
+ // ARange respectively. If ARange is empty then [] is returned.
+ // This means that ARange can be explicitly cast to a string using
+ // string(ARange).
+ class operator Explicit(const ARange: TIntegerRange): string;
+
+ // The lower bound of a non-empty range.
+ // EInvalidOpException is raised if the property is read when the range is
+ // empty.
+ property LowerBound: Integer read GetLowerBound;
+
+ // The upper bound of a non-empty range.
+ // EInvalidOpException is raised if the property is read when the range is
+ // empty.
+ property UpperBound: Integer read GetUpperBound;
+ end;
+
+class operator TIntegerRange.Add(const A, B: TIntegerRange): TIntegerRange;
+begin
+ if A.IsEmpty then
+ Exit(B);
+ if B.IsEmpty then
+ Exit(A);
+ Result := TIntegerRange.Create(
+ Math.Min(A.fLowerBound, B.fLowerBound),
+ Math.Max(A.fUpperBound, B.fUpperBound)
+ );
+end;
+
+function TIntegerRange.Constrain(const AValue: Integer): Integer;
+begin
+ if IsEmpty then
+ raise Sysutils.EInvalidOpException.Create(
+ 'TIntegerRange.Constrain not valid for an empty range.'
+ );
+ Result := Math.EnsureRange(AValue, fLowerBound, fUpperBound);
+end;
+
+constructor TIntegerRange.Create(const A, B: Integer);
+begin
+ // Normalise range so that smallest parameter is the lower bound
+ fLowerBound := Math.Min(A, B);
+ fUpperBound := Math.Max(A, B);
+ if fLowerBound = Low(Integer) then
+ // This restriction is required to prevent the Length method's Cardinal
+ // return value from wrapping around / overflowing
+ raise SysUtils.EArgumentException.CreateFmt(
+ 'TIntegerRange.Create: Arguments must be greater than %d', [Low(Integer)]
+ );
+end;
+
+class function TIntegerRange.CreateEmpty: TIntegerRange;
+begin
+ Result.fLowerBound := High(Integer);
+ Result.fUpperBound := Low(Integer);
+end;
+
+class operator TIntegerRange.Equal(const A, B: TIntegerRange): Boolean;
+begin
+ if A.IsEmpty or B.IsEmpty then
+ Exit(A.IsEmpty and B.IsEmpty);
+ Result := (A.fLowerBound = B.fLowerBound) and (A.fUpperBound = B.fUpperBound);
+end;
+
+class operator TIntegerRange.Explicit(const ARange: TIntegerRange): string;
+begin
+ if ARange.IsEmpty then
+ Exit('[]');
+ Result := SysUtils.Format(
+ '[%d..%d]', [ARange.fLowerBound, ARange.fUpperBound]
+ );
+end;
+
+function TIntegerRange.GetLowerBound: Integer;
+begin
+ if IsEmpty then
+ raise Sysutils.EInvalidOpException.Create(
+ 'TIntegerRange.LowerBound not valid for an empty range.'
+ );
+ Result := fLowerBound;
+end;
+
+function TIntegerRange.GetUpperBound: Integer;
+begin
+ if IsEmpty then
+ raise Sysutils.EInvalidOpException.Create(
+ 'TIntegerRange.LowerBound not valid for an empty range.'
+ );
+ Result := fUpperBound;
+end;
+
+class operator TIntegerRange.GreaterThanOrEqual(const A, B: TIntegerRange):
+ Boolean;
+begin
+ Result := B.IsSubrangeOf(A);
+end;
+
+class operator TIntegerRange.Implicit(const ARange: TIntegerRange): string;
+begin
+ Result := string(ARange); // calls Explicit cast operator
+end;
+
+class operator TIntegerRange.In(const AValue: Integer;
+ const ARange: TIntegerRange): Boolean;
+begin
+ if ARange.IsEmpty then
+ Exit(False);
+ Result := (AValue >= ARange.fLowerBound) and (AValue <= ARange.fUpperBound);
+end;
+
+function TIntegerRange.IsContiguousWith(const ARange: TIntegerRange): Boolean;
+begin
+ if Self.IsEmpty or ARange.IsEmpty then
+ Exit(False);
+ Result := (Self + ARange).Length = (Self.Length + ARange.Length);
+end;
+
+function TIntegerRange.IsContinuousWith(const ARange: TIntegerRange): Boolean;
+begin
+ if Self.IsEmpty or ARange.IsEmpty then
+ // Empty ranges are only continuous with other empty ranges
+ Exit(True);
+ Result := IsContiguousWith(ARange) or OverlapsWith(ARange);
+end;
+
+function TIntegerRange.IsEmpty: Boolean;
+begin
+ Result := fLowerBound > fUpperBound;
+end;
+
+function TIntegerRange.IsSubrangeOf(const ARange: TIntegerRange): Boolean;
+begin
+ if ARange.IsEmpty then
+ Exit(Self.IsEmpty);
+ Result := (Self.fLowerBound >= ARange.fLowerBound)
+ and (Self.fUpperBound <= ARange.fUpperBound)
+ or Self.IsEmpty
+end;
+
+function TIntegerRange.Length: Cardinal;
+begin
+ if IsEmpty then
+ Exit(0);
+ Result := fUpperBound - fLowerBound + 1
+end;
+
+class operator TIntegerRange.LessThanOrEqual(const A, B: TIntegerRange):
+ Boolean;
+begin
+ Result := A.IsSubrangeOf(B);
+end;
+
+class operator TIntegerRange.Multiply(const A, B: TIntegerRange): TIntegerRange;
+var
+ Up, Lo: Integer;
+begin
+ if A.IsEmpty or B.IsEmpty then
+ Exit(TIntegerRange.CreateEmpty);
+ Lo := Math.Max(A.fLowerBound, B.fLowerBound);
+ Up := Math.Min(A.fUpperBound, B.fUpperBound);
+ if Lo <= Up then
+ Result := TIntegerRange.Create(Lo, Up)
+ else
+ Result := TIntegerRange.CreateEmpty;
+end;
+
+class operator TIntegerRange.NotEqual(const A, B: TIntegerRange): Boolean;
+begin
+ if A.IsEmpty or B.IsEmpty then
+ Exit(A.IsEmpty <> B.IsEmpty);
+ Result := (A.fLowerBound <> B.fLowerBound)
+ or (A.fUpperBound <> B.fUpperBound);
+end;
+
+function TIntegerRange.OverlapsWith(const ARange: TIntegerRange): Boolean;
+begin
+ Result := not (Self * ARange).IsEmpty;
+end;
\ No newline at end of file
diff --git a/collection/707.dat b/collection/707.dat
new file mode 100644
index 0000000..5bf0e60
--- /dev/null
+++ b/collection/707.dat
@@ -0,0 +1,8 @@
+function RandomString(const SL: Classes.TStrings): string; overload;
+begin
+ if SL.Count = 0 then
+ raise SysUtils.EArgumentException.Create(
+ 'RandomString called with empty string list'
+ );
+ Result := SL[Random(SL.Count)];
+end;
\ No newline at end of file
diff --git a/csdb/collection/CONTRIBUTORS b/collection/CONTRIBUTORS
similarity index 100%
rename from csdb/collection/CONTRIBUTORS
rename to collection/CONTRIBUTORS
diff --git a/csdb/collection/LICENSE b/collection/LICENSE
similarity index 92%
rename from csdb/collection/LICENSE
rename to collection/LICENSE
index b4eb85c..a2c93a8 100644
--- a/csdb/collection/LICENSE
+++ b/collection/LICENSE
@@ -2,7 +2,7 @@
>> Begin license text
-Copyright (c) 2020 Peter Johnson and Contributors.
+Copyright (c) 2005-2025 Peter Johnson and Contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
diff --git a/csdb/collection/LICENSE-INFO b/collection/LICENSE-INFO
similarity index 88%
rename from csdb/collection/LICENSE-INFO
rename to collection/LICENSE-INFO
index a013caa..d36c9b7 100644
--- a/csdb/collection/LICENSE-INFO
+++ b/collection/LICENSE-INFO
@@ -1,6 +1,6 @@
LicenseName=MIT License
LicenseSPDX=MIT
LicenseURL=https://opensource.org/licenses/MIT
-CopyrightDate=2005-2020
+CopyrightDate=2005-2025
CopyrightHolder=Peter Johnson & Contributors
CopyrightHolderURL=http://gravatar.com/delphidabbler
diff --git a/csdb/collection/TESTERS b/collection/TESTERS
similarity index 100%
rename from csdb/collection/TESTERS
rename to collection/TESTERS
diff --git a/collection/VERSION b/collection/VERSION
new file mode 100644
index 0000000..fa83117
--- /dev/null
+++ b/collection/VERSION
@@ -0,0 +1 @@
+2.3.0
diff --git a/csdb/collection/arrays.ini b/collection/arrays.ini
similarity index 71%
rename from csdb/collection/arrays.ini
rename to collection/arrays.ini
index 2692d1f..d216dad 100644
--- a/csdb/collection/arrays.ini
+++ b/collection/arrays.ini
@@ -2,13 +2,16 @@
#
# Arrays category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[ArrayToStringList]
DescEx="Copies the elements of string array Strings to string list SL , replacing any existing contents of SL .
"
SeeAlso=StringListToArray
Units=Classes
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Arrays"
Snip=533.dat
Delphi2=N
Delphi3=N
@@ -26,11 +29,16 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ByteArraysEqual]
DescEx="Checks if two byte arrays are equal.
The arrays are equal if they have the same number of elements and elements at the same position in the array are equal.
"
SeeAlso=ByteArraysSameStart
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Arrays"
Snip=365.dat
Delphi2=N
Delphi3=N
@@ -48,11 +56,16 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ByteArraysSameStart]
DescEx="Checks if two byte arrays B1 and B2 are equal for the first Count elements.
False is returned if any array has less than Count elements.
Count must be >= 1.
"
SeeAlso=ByteArraysEqual
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Arrays"
Snip=481.dat
Delphi2=N
Delphi3=N
@@ -70,11 +83,16 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IndexOfByte]
DescEx="Returns the index of the first occurrence of byte B in byte array A , or -1 if B is not in A .
"
SeeAlso=LastIndexOfByte
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Arrays"
Snip=482.dat
Delphi2=N
Delphi3=N
@@ -92,11 +110,16 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[LastIndexOfByte]
DescEx="Returns the index of the last occurrence of byte B in byte array A , or -1 if B is not in A .
"
SeeAlso=IndexOfByte
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Arrays"
Snip=483.dat
Delphi2=N
Delphi3=N
@@ -114,12 +137,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[StringListToArray]
DescEx="Creates and returns a dynamic string array containing all the strings from the given string list.
"
SeeAlso=ArrayToStringList
Units=Classes,Types
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Arrays"
Snip=347.dat
Delphi2=N
Delphi3=N
@@ -137,12 +165,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[AppendByteArray]
DescEx="Appends array of bytes B2 to the end of byte array B1 .
"
Depends=TBytes
SeeAlso=ConcatByteArrays
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Arrays"
Snip=364.dat
Delphi2=N
Delphi3=N
@@ -160,12 +193,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ChopByteArray]
DescEx="Deletes a sequence of bytes from byte array B starting at index Start with length Len .
If either Start or Len are less than 0 they are taken as zero. If Start is beyond the end of the array or if Len is 0 then the whole array is returned unchanged. If the sequence of bytes to be chopped extends beyond the end of the array it is truncated from Start .
"
Depends=TBytes,ConcatByteArrays,SliceByteArray
SeeAlso=SliceByteArray
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Arrays"
Snip=366.dat
Delphi2=N
Delphi3=N
@@ -183,6 +221,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[CloneByteArray]
@@ -190,6 +230,9 @@ DescEx="Makes a copy of an array of bytes.
"
Extra="Useful for creating a TBytes array from a constant array or for cloning an existing byte array.
"
Depends=TBytes
SeeAlso=AppendByteArray
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Arrays"
Snip=367.dat
Delphi2=N
Delphi3=N
@@ -207,12 +250,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ConcatByteArrays]
DescEx="Concatenates two byte arrays B1 and B2 and returns the resulting array.
The result is the contents of B1 followed by the contents of B2 .
"
Depends=TBytes,AppendByteArray,CloneByteArray
SeeAlso=AppendByteArray
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Arrays"
Snip=368.dat
Delphi2=N
Delphi3=N
@@ -230,12 +278,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[PopByteArray]
DescEx="Removes the last element of byte array A and returns the element. The length of A shrinks by one.
A must not be empty.
"
Depends=TBytes
SeeAlso=PushByteArray,ShiftByteArray,UnShiftByteArray
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Arrays"
Snip=484.dat
Delphi2=N
Delphi3=N
@@ -253,12 +306,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[PushByteArray]
DescEx="Pushes byte B onto the end of byte array A . The length of A grows by one.
"
Depends=TBytes
SeeAlso=PopByteArray,ShiftByteArray,UnShiftByteArray
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Arrays"
Snip=485.dat
Delphi2=N
Delphi3=N
@@ -276,12 +334,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ShiftByteArray]
DescEx="Removes the first element of byte array A and returns the element. The length of A shrinks by one.
A must not be empty.
"
Depends=TBytes
SeeAlso=PopByteArray,PushByteArray,UnShiftByteArray
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Arrays"
Snip=486.dat
Delphi2=N
Delphi3=N
@@ -299,12 +362,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SliceByteArray]
DescEx="Slices a range of bytes from byte array B , starting at index Start with length Len , and returns the result.
If either Start or Len are less than 0, they are taken as 0. If Start is beyond the end of the array or if Len is 0 then an empty array is returned. If the sequence of bytes to be sliced extends beyond the end of the array it is truncated from Start .
"
Depends=TBytes
SeeAlso=ChopByteArray
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Arrays"
Snip=369.dat
Delphi2=N
Delphi3=N
@@ -322,12 +390,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[UnShiftByteArray]
DescEx="Inserts byte B at the beginning of byte array A . The length of A grows by one.
"
Depends=TBytes
SeeAlso=PopByteArray,PushByteArray,ShiftByteArray
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Arrays"
Snip=487.dat
Delphi2=N
Delphi3=N
@@ -345,6 +418,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TArrayUtils]
@@ -353,6 +428,8 @@ DescEx="A method-only advanced record that provides utility methods for worki
Units=Generics.Defaults
SeeAlso=IndexOfByte,ByteArraysEqual,ByteArraysSameStart
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Arrays"
Snip=623.dat
Delphi2=N
Delphi3=N
@@ -361,13 +438,21 @@ Delphi5=N
Delphi6=N
Delphi7=N
Delphi2005Win32=N
-Delphi2006Win32=Y
+Delphi2006Win32=N
Delphi2007=N
-Delphi2009Win32=Y
-Delphi2010=Y
DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=N
+Delphi12A=Y
+Delphi13F=Y
+
+[ReverseByteArray]
+Kind=routine
+DisplayName=ReverseByteArray
+DescEx="
Returns a copy of a given byte array with the order of the bytes reversed.
"
+Depends=TBytes
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Arrays"
+Snip=656.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
diff --git a/csdb/collection/categories.ini b/collection/categories.ini
similarity index 94%
rename from csdb/collection/categories.ini
rename to collection/categories.ini
index 70642ad..a11174b 100644
--- a/csdb/collection/categories.ini
+++ b/collection/categories.ini
@@ -2,7 +2,7 @@
#
# Master categories file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[arrays]
diff --git a/csdb/collection/consts.ini b/collection/consts.ini
similarity index 87%
rename from csdb/collection/consts.ini
rename to collection/consts.ini
index ba9ad18..fac71ca 100644
--- a/csdb/collection/consts.ini
+++ b/collection/consts.ini
@@ -2,7 +2,7 @@
#
# Constants category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[SHIL_Enum]
@@ -28,4 +28,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
diff --git a/csdb/collection/date.ini b/collection/date.ini
similarity index 90%
rename from csdb/collection/date.ini
rename to collection/date.ini
index a48cd46..9ff8104 100644
--- a/csdb/collection/date.ini
+++ b/collection/date.ini
@@ -2,7 +2,7 @@
#
# Date and Time category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[AddDays]
@@ -26,6 +26,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[AdjustedTimeZoneBias]
@@ -49,6 +51,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DateDay]
@@ -57,6 +61,8 @@ Extra="Adapted from code contributed by Bill Miller.
"
Units=SysUtils
SeeAlso=DateMonth,DateYear,DayOfYear
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
Snip=224.dat
Delphi2=Y
Delphi3=Y
@@ -74,6 +80,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DateMonth]
@@ -98,6 +106,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DateMonthEnd]
@@ -107,6 +117,8 @@ Units=SysUtils
SeeAlso=DateMonth,DateMonthStart,DaysInMonth
Depends=DaysInMonth
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
Snip=441.dat
Delphi2=Y
Delphi3=Y
@@ -124,6 +136,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DateMonthStart]
@@ -132,6 +146,8 @@ Extra="The date returned is midnight at the beginning of the first day of the
Units="SysUtils"
SeeAlso=DateMonth,DateMonthEnd
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
Snip=442.dat
Delphi2=Y
Delphi3=Y
@@ -149,6 +165,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DateQuarter]
@@ -157,6 +175,8 @@ Extra="
Based on code contributed by Homolibere.
"
Units=SysUtils
SeeAlso=DateQuarterStart,DateQuarterEnd
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
Snip=413.dat
Delphi2=Y
Delphi3=Y
@@ -174,6 +194,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DateQuarterEnd]
@@ -182,6 +204,8 @@ Extra="Modified from code contributed by Homolibere.
"
Units=SysUtils
SeeAlso=DateQuarter,DateQuarterStart
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
Snip=414.dat
Delphi2=N
Delphi3=N
@@ -199,6 +223,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DateQuarterStart]
@@ -207,6 +233,8 @@ Extra="Modified from code contributed by Homolibere.
"
Units=SysUtils
SeeAlso=DateQuarter,DateQuarterEnd
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
Snip=415.dat
Delphi2=N
Delphi3=N
@@ -224,6 +252,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DateTimeToUnixDate]
@@ -246,6 +276,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DateTimeToWinFileTime]
@@ -269,6 +301,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DateYear]
@@ -293,6 +327,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DateYearEnd]
@@ -301,6 +337,8 @@ Extra="The date returned is midnight at the beginning of the last day of the
Units=SysUtils
SeeAlso=DateYear,DateYearStart
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
Snip=443.dat
Delphi2=Y
Delphi3=Y
@@ -318,6 +356,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DateYearStart]
@@ -326,6 +366,8 @@ Extra="
The date returned is midnight at the beginning of the first day of the
Units=SysUtils
SeeAlso=DateYear,DateYearEnd
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
Snip=444.dat
Delphi2=Y
Delphi3=Y
@@ -343,6 +385,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DayOfYear]
@@ -367,6 +411,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DaysInMonth]
@@ -391,6 +437,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DiffDays]
@@ -414,6 +462,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[Is24HourTimeFormat]
@@ -437,6 +487,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[IsDaylightSaving]
@@ -460,6 +512,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsFriday]
@@ -484,6 +538,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsLeapYear]
@@ -508,6 +564,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsMonday]
@@ -532,6 +590,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsSaturday]
@@ -556,6 +616,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsSunday]
@@ -580,6 +642,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsThursday]
@@ -604,6 +668,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsTuesday]
@@ -628,6 +694,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsValidDate]
@@ -652,6 +720,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsValidTime]
@@ -676,6 +746,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsWednesday]
@@ -700,6 +772,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsWeekday]
@@ -724,6 +798,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsWeekend]
@@ -748,6 +824,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[MSecToDateTime]
@@ -770,6 +848,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SQLDate]
@@ -777,6 +857,8 @@ DescEx="
Formats a date in SQL format.
"
Units=SysUtils
SeeAlso=SQLDateToDateTime
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
Snip=237.dat
Delphi2=Y
Delphi3=Y
@@ -794,6 +876,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SQLDateToDateTime]
@@ -802,6 +886,8 @@ Extra="Handles only the date component. Any time component is ignored.
"
Units=SysUtils
SeeAlso=SQLDate
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
Snip=412.dat
Delphi2=Y
Delphi3=Y
@@ -819,6 +905,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TimeHour]
@@ -843,6 +931,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TimeMin]
@@ -867,6 +957,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TimeSec]
@@ -891,6 +983,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TimeZoneBias]
@@ -915,6 +1009,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TimeZoneName]
@@ -939,6 +1035,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[UnixDateToDateTime]
@@ -961,6 +1059,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[WinFileTimeToDateTime]
@@ -984,6 +1084,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[WinFileTimeToDOSFileTime]
@@ -1007,6 +1109,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[WinFileTimeToStr]
@@ -1031,6 +1135,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GMTToLocalTime]
@@ -1055,6 +1161,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[LongDayName]
@@ -1083,6 +1191,13 @@ DelphiXE6=N
DelphiXE7=N
DelphiXE8=N
Delphi10S=N
+Delphi101B=N
+Delphi102T=N
+Delphi103R=N
+Delphi104S=N
+Delphi11A=N
+Delphi12A=N
+Delphi13F=N
FPC=Y
[LongDayNameXE]
@@ -1107,6 +1222,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[LongMonthName]
@@ -1136,6 +1253,13 @@ DelphiXE6=N
DelphiXE7=N
DelphiXE8=N
Delphi10S=N
+Delphi101B=N
+Delphi102T=N
+Delphi103R=N
+Delphi104S=N
+Delphi11A=N
+Delphi12A=N
+Delphi13F=N
FPC=Y
[LongMonthNameXE]
@@ -1161,6 +1285,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[MinsToStr]
@@ -1180,6 +1306,8 @@ DelphiXE3=Y
DelphiXE4=Y
DelphiXE6=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[NowGMT]
@@ -1198,13 +1326,15 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RFC1123DateGMT]
DescEx="Returns the given date time value, which must be in GMT/UTC, as a RFC1123 formatted string.
"
Units=SysUtils
SeeAlso=NowGMT
-TestInfo=advanced
+TestInfo=basic
Snip=629.dat
Delphi2=N
Delphi3=Y
@@ -1222,6 +1352,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RFC2822Date]
@@ -1245,6 +1377,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SecondsToTime]
@@ -1268,6 +1402,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ShortDayName]
@@ -1296,6 +1432,13 @@ DelphiXE6=N
DelphiXE7=N
DelphiXE8=N
Delphi10S=N
+Delphi101B=N
+Delphi102T=N
+Delphi103R=N
+Delphi104S=N
+Delphi11A=N
+Delphi12A=N
+Delphi13F=N
FPC=Y
[ShortDayNameXE]
@@ -1320,6 +1463,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ShortMonthName]
@@ -1349,6 +1494,13 @@ DelphiXE6=N
DelphiXE7=N
DelphiXE8=N
Delphi10S=N
+Delphi101B=N
+Delphi102T=N
+Delphi103R=N
+Delphi104S=N
+Delphi11A=N
+Delphi12A=N
+Delphi13F=N
FPC=Y
[ShortMonthNameXE]
@@ -1374,6 +1526,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[WesternEaster]
@@ -1381,6 +1535,8 @@ DescEx="Returns the date of Easter Sunday for the given year in the Gregorian
Extra="
This routine is derived from a snippet taken from the SWAG Archive. That snippet was converted to Pascal by Kerry Sokalsky from Modula-2 code written by Greg Vigneault in 1993.
The algorithm was taken from chapter 4 of "Astronomical Formulae for Calculators" 2nd edition; by Jean Meeus; publisher: Willmann-Bell Inc., ISBN 0-943396-01-8.
The algorithm is valid for all years in the Gregorian calendar, i.e. from 1583 onwards. The extreme dates of Easter are March 22 (as in 1818 and 2285) and April 25 (as in 1886, 1943, 2038).
For more details of the algorithm see this article on Wikipedia.
"
Units=SysUtils
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
Snip=610.dat
Delphi7=Y
Delphi2005Win32=Y
@@ -1393,4 +1549,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
diff --git a/csdb/collection/drive.ini b/collection/drive.ini
similarity index 77%
rename from csdb/collection/drive.ini
rename to collection/drive.ini
index 1033d49..32fb2d7 100644
--- a/csdb/collection/drive.ini
+++ b/collection/drive.ini
@@ -2,12 +2,15 @@
#
# Drive Management category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[CurentDrive]
DescEx="Returns the letter that identifies the current drive.
"
Extra="Modified from Bill Miller's snippets collection.
"
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
Snip=352.dat
Delphi2=Y
Delphi3=Y
@@ -25,6 +28,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DriveDisplayNames]
@@ -32,6 +37,9 @@ DescEx="Gets list of display names for all the system's drives and stores in
Units=Classes,ShellAPI,SysUtils
Depends=ListDrives,DriveDisplayName
SeeAlso=DriveDisplayName,ListDrives
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
Snip=070.dat
Delphi2=N
Delphi3=N
@@ -49,11 +57,16 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DriveRootPath]
DescEx="
Returns root drive path for drive with given number.
"
SeeAlso=DriveTypeFromPath,IsValidDriveNum
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
Snip=064.dat
Delphi2=Y
Delphi3=Y
@@ -71,12 +84,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DriveTypeFromPath]
DescEx="Returns type of drive that contains the given (full) path.
"
Units=Windows,SysUtils
SeeAlso=DriveRootPath,DriveDisplayName,IsValidDrive
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
Snip=028.dat
Delphi2=Y
Delphi3=Y
@@ -94,12 +112,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[FileSystemName]
DescEx="Returns name of a drive's file system or empty string if file system can't be determined or drive is not valid.
"
Units=Windows
SeeAlso=VolumeName
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
Snip=138.dat
Delphi2=N
Delphi3=N
@@ -117,12 +140,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[VolumeName]
DescEx="Returns the volume name of the given drive or empty string if the volume has no name or the drive is not valid.
"
Units=Windows
SeeAlso=FileSystemName,DeleteVolumeName,SetVolumeName
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
Snip=137.dat
Delphi2=N
Delphi3=N
@@ -140,6 +168,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DeleteVolumeName]
@@ -147,6 +177,9 @@ DescEx="Deletes an existing volume label on a given drive. Returns True on su
Extra="
Note: Fails and returns False if the process has insufficient privileges to set the volume name.
"
Units=Windows
SeeAlso=VolumeName,SetVolumeName
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
Snip=329.dat
Delphi2=Y
Delphi3=Y
@@ -164,12 +197,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DiskSpaceInfo]
DescEx="Gets information about the size of a drive and the space available to the current user. Returns True if the the required information can be obtained and False if not.
On success AvailBytes is the amount of space available to the current user, TotalBytes is the total number of bytes on the disk that is available to the current user and FreeBytes is the total number of free bytes on the disk.
"
Extra="Drive must be a valid drive such as C:\ or a UNC name such as \\MyServer\MyShare\ (with trailing backslash).
If per-user disk quotas are being used then the value of AvailBytes maybe less than the free space available on the disk and TotalBytes may be less that the total number of bytes on the disk.
Loosely based on code contributed by Bill Miller.
"
Units=SysUtils
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
Snip=166.dat
Delphi2=N
Delphi3=N
@@ -187,6 +225,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[DriveDisplayName]
@@ -194,6 +234,9 @@ DescEx="Returns the display name for the drive with the given root path.
"
Extra="Note: On versions of Delphi that do not support the SysUtils.RaiseLastOSError routine, this call can be replaced by RaiseLastWin32Error .
"
Units=ShellAPI,SysUtils
SeeAlso=DriveDisplayNames,DriveTypeFromPath,ListDrives
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
Snip=069.dat
Delphi2=N
Delphi3=N
@@ -211,6 +254,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetDriveNumber]
@@ -219,6 +264,9 @@ Extra="Drive can be specified as a disk letter (e.g. C Returns the serial number of the volume whose root directory is contained in the Drive parameter. Returns 0 if the given drive is not valid or has no serial number.
"
Extra="The Drive parameter must either be the name of a local drive (e.g. C:\ ) or network share (e.g. \\MyServer\MyShare\ ). A trailing backslash must be provided. A drive letter on its own will not be recognised.
"
Units=Windows
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
Snip=066.dat
Delphi2=Y
Delphi3=Y
@@ -259,6 +312,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsDriveReady]
@@ -267,6 +322,9 @@ Extra="Drive can be specified as a disk letter (e.g. C Checks if the given drive path represents a valid drive.
"
Extra="A valid drive can be a disk letter (e.g. C ), a drive name (e.g C: or C:\ ) or an absolute file path on the drive (e.g. C:\Foo\Bar.txt ).
"
Depends=DriveTypeFromPath,IsDriveReady
SeeAlso=IsValidDriveNum,DriveTypeFromPath
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
Snip=072.dat
Delphi2=Y
Delphi3=Y
@@ -308,6 +371,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsValidDriveNum]
@@ -315,6 +380,9 @@ DescEx="Returns True if the drive specified by the given number is valid and
Extra="
Drive numbers must be in the range 0..25, with 0 mapping onto A:\ and 25 mapping onto Z:\ .
"
Units=Windows
SeeAlso=IsValidDrive,GetDriveNumber
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
Snip=073.dat
Delphi2=Y
Delphi3=Y
@@ -332,6 +400,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ListDrives]
@@ -340,6 +410,9 @@ Extra="Note: On versions of Delphi that do not support the <
Units=Classes,Windows,SysUtils
Depends=MultiSzToStrings
SeeAlso=DriveDisplayName,DriveDisplayNames
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
Snip=068.dat
Delphi2=N
Delphi3=N
@@ -357,6 +430,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SetVolumeName]
@@ -364,6 +439,9 @@ DescEx="
Sets the name of the volume on a given drive. Returns True on success
Extra="
Note: Fails and returns False if the process has insufficient privileges to set the volume name.
"
Units=Windows
SeeAlso=DeleteVolumeName,VolumeName
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
Snip=330.dat
Delphi2=Y
Delphi3=Y
@@ -381,4 +459,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
diff --git a/csdb/collection/encoding.ini b/collection/encoding.ini
similarity index 95%
rename from csdb/collection/encoding.ini
rename to collection/encoding.ini
index 14c8096..49f69f5 100644
--- a/csdb/collection/encoding.ini
+++ b/collection/encoding.ini
@@ -2,7 +2,7 @@
#
# Encoding category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[BytesToAnsiString]
@@ -26,6 +26,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[CodePageSupportsString]
@@ -50,6 +52,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[EncodingSupportsString]
@@ -73,6 +77,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsASCIIChar]
@@ -95,6 +101,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsASCIIDigit]
@@ -117,6 +125,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsASCIIText]
@@ -141,6 +151,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsUTF16BEFile]
@@ -165,6 +177,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsUTF16BEStream]
@@ -188,6 +202,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsUTF16File]
@@ -212,6 +228,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsUTF16LEFile]
@@ -236,6 +254,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsUTF16LEStream]
@@ -259,6 +279,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsUTF16Stream]
@@ -282,6 +304,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsUTF8File]
@@ -306,6 +330,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsUTF8Stream]
@@ -329,6 +355,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsASCIIFile]
@@ -354,6 +382,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsASCIIStream]
@@ -379,6 +409,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsUnicodeFile]
@@ -404,6 +436,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsUnicodeStream]
@@ -428,6 +462,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsUTF7File]
@@ -453,6 +489,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsUTF7Stream]
@@ -477,6 +515,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SafeFreeEncoding]
@@ -499,4 +539,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
diff --git a/csdb/collection/file.ini b/collection/file.ini
similarity index 95%
rename from csdb/collection/file.ini
rename to collection/file.ini
index b852aa2..676a655 100644
--- a/csdb/collection/file.ini
+++ b/collection/file.ini
@@ -2,7 +2,7 @@
#
# File Management category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[CopyFile]
@@ -26,6 +26,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[CopyFiles]
@@ -51,6 +53,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[CreateURLShortcut]
@@ -73,6 +77,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DefaultFileExt]
@@ -96,6 +102,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DeleteFiles]
@@ -120,6 +128,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DeleteFilesWithUndo]
@@ -145,6 +155,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DeleteFileWithUndo]
@@ -168,6 +180,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DirToPath]
@@ -190,6 +204,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DOSToUnixPath]
@@ -212,6 +228,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[EnsureFolders]
@@ -236,6 +254,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[FileSizeString]
@@ -260,6 +280,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ForceFileExt]
@@ -283,6 +305,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetFileDate]
@@ -306,6 +330,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetFixedFileVerInfo]
@@ -329,6 +355,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetLastDirectory]
@@ -353,6 +381,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[HasFileExt]
@@ -376,6 +406,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[HasVerInfo]
@@ -399,6 +431,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsArchiveFile]
@@ -423,6 +457,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsFile]
@@ -447,6 +483,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsHiddenFile]
@@ -471,6 +509,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsReadOnlyFile]
@@ -495,6 +535,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsSystemFile]
@@ -519,6 +561,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsURLShortcut]
@@ -542,6 +586,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsValidFileName]
@@ -566,6 +612,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ListFiles]
@@ -590,6 +638,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[LongToShortFilePath]
@@ -613,6 +663,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[PathIsRoot]
@@ -637,6 +689,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[PathToDir]
@@ -659,6 +713,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RemoveFileExt]
@@ -682,6 +738,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SetFileDate]
@@ -705,6 +763,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SizeOfFile64]
@@ -729,6 +789,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[Touch]
@@ -751,6 +813,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[URLFromShortcut]
@@ -775,6 +839,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[CountFiles]
@@ -799,6 +865,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DirPurge]
@@ -821,6 +889,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ExeType]
@@ -846,6 +916,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[FileInProgramDir]
@@ -869,6 +941,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetParentDirectory]
@@ -893,6 +967,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsDirectory]
@@ -918,6 +994,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsFolderEmpty]
@@ -943,6 +1021,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[IsHugeFile]
@@ -967,6 +1047,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsReservedDeviceName]
@@ -990,6 +1072,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ShortToLongFilePath]
@@ -1014,6 +1098,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SizeOfFile]
@@ -1038,6 +1124,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SizeOfFile2]
@@ -1062,6 +1150,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SubDirectoryCount]
@@ -1085,6 +1175,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[TempFileName]
@@ -1109,6 +1201,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TempFileNameEx]
@@ -1133,6 +1227,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TExeType]
@@ -1157,4 +1253,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
diff --git a/csdb/collection/graphics.ini b/collection/graphics.ini
similarity index 96%
rename from csdb/collection/graphics.ini
rename to collection/graphics.ini
index f0d493f..09ce726 100644
--- a/csdb/collection/graphics.ini
+++ b/collection/graphics.ini
@@ -2,7 +2,7 @@
#
# Graphics category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[AdjustColorBrightness]
@@ -27,6 +27,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[BitmapToMetafile]
@@ -50,6 +52,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[CloneCursorAsBitmap]
@@ -75,6 +79,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[CloneCursorAsIcon]
@@ -100,6 +106,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[CloneCursorHandleAsBitmap]
@@ -125,6 +133,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[CloneCursorHandleAsIcon]
@@ -149,6 +159,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[CloneGraphicAsBitmap]
@@ -174,6 +186,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[CloneJPEGAsBitmap]
@@ -198,6 +212,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[ColorToRGBTriple]
@@ -223,6 +239,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[ContrastingColor]
@@ -247,6 +265,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[CursorHandleToBitmap]
@@ -271,6 +291,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[CursorToBitmap]
@@ -295,6 +317,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[DrawAngledText]
@@ -319,6 +343,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[DrawDisabledText]
@@ -342,6 +368,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[DrawTextOutline]
@@ -366,6 +394,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[EllipsifyText]
@@ -389,6 +419,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[ExtractRGB]
@@ -413,6 +445,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[FontExists]
@@ -435,6 +469,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[GetIconANDBitmask]
@@ -458,6 +494,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[GetIconXORBitmask]
@@ -481,6 +519,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[GraphicToBitmap]
@@ -504,6 +544,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[IndexOfWidestString]
@@ -528,6 +570,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[IsColorIcon]
@@ -551,6 +595,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[IsEqualRGBTriple]
@@ -574,6 +620,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsGDIPlusInstalled]
@@ -596,6 +644,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[JPEGFileToBitmapFile]
@@ -619,6 +669,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[MakeGreyScale]
@@ -643,6 +695,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[MaxWidthOfStrings]
@@ -668,6 +722,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[RGBTripleToColor]
@@ -691,6 +747,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[SetDefaultFont]
@@ -715,6 +773,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[SetDesktopIconFont]
@@ -740,6 +800,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[SetVistaContentFont]
@@ -764,6 +826,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[SetVistaFont]
@@ -788,6 +852,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[StringExtent]
@@ -812,6 +878,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[AdjustBitmapBrightness]
@@ -836,6 +904,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[AdjustImage_A]
@@ -862,6 +932,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[AdjustImage_B]
@@ -888,6 +960,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[AdjustImage_C]
@@ -914,6 +988,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[ColorToHSB]
@@ -939,6 +1015,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[CountColors]
@@ -963,6 +1041,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[CreateDisplayDC]
@@ -986,6 +1066,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DarkenColor]
@@ -1011,6 +1093,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[GetBMPSize]
@@ -1035,6 +1119,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetGIFSize]
@@ -1059,6 +1145,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetIconHotspot]
@@ -1083,6 +1171,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[GetJPGSize]
@@ -1108,6 +1198,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetPNGSize]
@@ -1133,6 +1225,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GreyScale_A]
@@ -1159,6 +1253,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[GreyScale_B]
@@ -1185,6 +1281,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[HalftoneStretch_A]
@@ -1210,6 +1308,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[HalftoneStretch_B]
@@ -1235,6 +1335,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[InvertBitmap_A]
@@ -1260,6 +1362,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[InvertBitmap_B]
@@ -1285,6 +1389,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[IsCursorIcon]
@@ -1309,6 +1415,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[IsTrueTypeFont_A]
@@ -1334,6 +1442,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[IsTrueTypeFont_B]
@@ -1359,6 +1469,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[JPEGPixelFormatToPixelFormat]
@@ -1377,6 +1489,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[LightenColor]
@@ -1402,6 +1516,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[RGBToHSB]
@@ -1426,6 +1542,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RichEditToCanvas]
@@ -1449,6 +1567,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[ScaleBitmap_A]
@@ -1475,6 +1595,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[ScaleBitmap_B]
@@ -1501,6 +1623,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[AdjustImageTypes]
@@ -1525,6 +1649,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RGBQuadArray]
@@ -1550,6 +1676,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RGBTripleArray]
@@ -1575,6 +1703,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TColorRec]
@@ -1598,6 +1728,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TGreyScaleMethod]
@@ -1622,6 +1754,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[THSBColor]
@@ -1645,6 +1779,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[AdjustImageConsts]
@@ -1669,4 +1805,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
diff --git a/csdb/collection/hex.ini b/collection/hex.ini
similarity index 78%
rename from csdb/collection/hex.ini
rename to collection/hex.ini
index 214176b..b3df114 100644
--- a/csdb/collection/hex.ini
+++ b/collection/hex.ini
@@ -2,7 +2,7 @@
#
# Hex Utilities category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[AddHexPrefix]
@@ -12,6 +12,8 @@ Units=SysUtils
Depends=StripHexPrefix
SeeAlso=StripHexPrefix
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
Snip=311.dat
Delphi2=N
Delphi3=N
@@ -29,12 +31,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[BufToHex]
DescEx="Returns a hexadecimal representation of the bytes in the given buffer which has the given size.
"
SeeAlso=BytesToHex,ByteToHex,LongWordToHex,QuadWordToHex,WordToHex
TestInfo=advanced
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
Snip=312.dat
Delphi2=Y
Delphi3=Y
@@ -52,6 +59,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[BytesToHex]
@@ -59,6 +68,8 @@ DescEx="Returns a hexadecimal representation of the given array of bytes.
Depends=BufToHex
SeeAlso=BufToHex,ByteToHex,LongWordToHex,QuadWordToHex,WordToHex
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
Snip=313.dat
Delphi2=N
Delphi3=N
@@ -76,6 +87,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ByteToHex]
@@ -83,6 +96,8 @@ DescEx="Returns the hexadecimal representation of the given byte value.
"
Units=SysUtils
SeeAlso=BufToHex,BytesToHex,LongWordToHex,QuadWordToHex,WordToHex
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
Snip=314.dat
Delphi2=Y
Delphi3=Y
@@ -100,6 +115,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[LongWordToHex]
@@ -107,6 +124,8 @@ DescEx="Returns the hexadecimal representation of the given long (4 byte) wor
Units=SysUtils
SeeAlso=BufToHex,BytesToHex,ByteToHex,QuadWordToHex,WordToHex
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
Snip=315.dat
Delphi2=N
Delphi3=N
@@ -124,6 +143,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[QuadWordToHex]
@@ -131,6 +152,8 @@ DescEx="
Returns the hexadecimal representation of the given quad (8 byte) wor
Units=SysUtils
SeeAlso=BufToHex,BytesToHex,ByteToHex,LongWordToHex,WordToHex
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
Snip=316.dat
Delphi2=N
Delphi3=N
@@ -148,6 +171,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[StripHexPrefix]
@@ -155,6 +180,8 @@ DescEx="
Strips any prefix from the given hexadecimal string. Both Delphi ('$'
Units=SysUtils
SeeAlso=AddHexPrefix
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
Snip=310.dat
Delphi2=Y
Delphi3=Y
@@ -172,6 +199,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TryHexToInt]
@@ -180,6 +209,8 @@ Extra="
The hexadecimal string must contain only valid hex digits, optionally
Depends=AddHexPrefix
SeeAlso=HexToInt,HexToIntDef,TryHexToBuf,TryHexToInt64
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
Snip=319.dat
Delphi2=N
Delphi3=N
@@ -197,6 +228,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TryHexToInt64]
@@ -205,6 +238,8 @@ Extra="
The hexadecimal string must contain only valid hex digits, optionally
Depends=AddHexPrefix
SeeAlso=HexToInt64,HexToInt64Def,TryHexToBuf,TryHexToInt
TestInfo=advanced
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
+AdvancedTest.Level=unit-tests
Snip=320.dat
Delphi2=N
Delphi3=N
@@ -222,6 +257,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[WordToHex]
@@ -229,6 +266,8 @@ DescEx="
Returns the hexadecimal representation of the given (2 byte) word val
Units=SysUtils
SeeAlso=BufToHex,BytesToHex,ByteToHex,LongWordToHex,QuadWordToHex
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
Snip=317.dat
Delphi2=Y
Delphi3=Y
@@ -246,6 +285,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[HexByteSize]
@@ -254,6 +295,8 @@ Extra="
Assumes that HexStr contains only valid hex digits, optiona
Depends=StripHexPrefix
SeeAlso=HexToBuf
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
Snip=318.dat
Delphi2=Y
Delphi3=Y
@@ -271,6 +314,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[HexToBuf]
@@ -279,6 +324,8 @@ Extra="
Use HexByteSize to determine the size of buffer required. T
Depends=TryHexToBuf
SeeAlso=TryHexToBuf,HexToBytes,HexToInt,HexToInt64
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
Snip=323.dat
Delphi2=N
Delphi3=N
@@ -296,6 +343,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[HexToBytes]
@@ -304,6 +353,8 @@ Extra="
HexStr must contain only valid hex digits, optionally prefi
Depends=TBytes,TryHexToBytes
SeeAlso=TryHexToBytes,HexToBuf,HexToInt,HexToInt64
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
Snip=324.dat
Delphi2=N
Delphi3=N
@@ -321,6 +372,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[HexToInt]
@@ -329,6 +382,8 @@ Extra="
HexStr must contain only valid hex digits, optionally prefi
Depends=TryHexToInt
SeeAlso=TryHexToInt,HexToIntDef,HexToBuf,HexToBytes,HexToInt64
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
Snip=325.dat
Delphi2=N
Delphi3=N
@@ -346,6 +401,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[HexToInt64]
@@ -354,6 +411,8 @@ Extra="
HexStr must contain only valid hex digits, optionally prefi
Depends=TryHexToInt64
SeeAlso=TryHexToInt64,HexToInt64Def,HexToBuf,HexToBytes,HexToInt
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
Snip=326.dat
Delphi2=N
Delphi3=N
@@ -371,6 +430,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[HexToInt64Def]
@@ -379,6 +440,8 @@ Extra="
HexStr may be prefixed by either '$' or '0x' or have no pre
Depends=TryHexToInt64
SeeAlso=TryHexToInt64,HexToInt64,HexToIntDef
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
Snip=328.dat
Delphi2=N
Delphi3=N
@@ -396,6 +459,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[HexToIntDef]
@@ -404,6 +469,8 @@ Extra="
HexStr may be prefixed by either '$' or '0x' or have no pre
Depends=TryHexToInt
SeeAlso=TryHexToInt,HexToInt,HexToInt64Def
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
Snip=327.dat
Delphi2=N
Delphi3=N
@@ -421,6 +488,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TryHexToBuf]
@@ -429,6 +498,8 @@ Extra="
The hexadecimal string must not be empty and contain only valid hex di
Depends=StripHexPrefix,TryHexToInt
SeeAlso=HexToBuf,TryHexToBytes,TryHexToInt,TryHexToInt64
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
Snip=321.dat
Delphi2=N
Delphi3=N
@@ -446,6 +517,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TryHexToBytes]
@@ -454,6 +527,8 @@ Extra="
The hexadecimal string must contain only valid hex digits, optionally
Depends=HexByteSize,TBytes,TryHexToBuf
SeeAlso=HexToBytes,TryHexToBuf,TryHexToInt,TryHexToInt64
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Hex"
Snip=322.dat
Delphi2=N
Delphi3=N
@@ -471,4 +546,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
diff --git a/csdb/collection/io.ini b/collection/io.ini
similarity index 95%
rename from csdb/collection/io.ini
rename to collection/io.ini
index 2370c5c..4ee75cc 100644
--- a/csdb/collection/io.ini
+++ b/collection/io.ini
@@ -2,7 +2,7 @@
#
# File and Stream I/O category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[FileToString]
@@ -27,6 +27,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[StreamToString]
@@ -50,6 +52,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[StringToFile]
@@ -74,6 +78,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[StringToStream]
@@ -97,6 +103,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[WideStringToUnicodeFile]
@@ -121,6 +129,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[WideStringToUnicodeStream]
@@ -144,6 +154,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[FileHasWatermark_A]
@@ -170,6 +182,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[FileHasWatermark_B]
@@ -195,6 +209,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[StreamHasWatermark]
@@ -219,6 +235,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[UnicodeFileToWideString]
@@ -244,6 +262,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[UnicodeStreamToWideString]
@@ -269,4 +289,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
diff --git a/collection/maths.ini b/collection/maths.ini
new file mode 100644
index 0000000..ee9f0fe
--- /dev/null
+++ b/collection/maths.ini
@@ -0,0 +1,2634 @@
+# DelphiDabbler Code Snippets Database v2
+#
+# Mathematics category file
+#
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
+# https://gravatar.com/delphidabbler
+
+[AllDigitsDifferent]
+DescEx="
Checks if all the digits of the given integer are different to each other.
"
+Extra="An example of an integer with all digits different is 15862.
"
+SeeAlso=AllDigitsSame
+Snip=498.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[AllDigitsSame]
+DescEx="Checks if all the digits of the given integer are the same.
"
+Extra="An example of an integer with all digits the same is 777777.
"
+SeeAlso=AllDigitsDifferent,RepeatedDigits
+Snip=499.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[ArraySum_Cardinal]
+DisplayName="ArraySum (Cardinal overload)"
+DescEx="Returns the sum of all Cardinal elements of array A .
0 is returned if the array is empty.
"
+SeeAlso=ArraySum_Double,ArraySum_Extended,ArraySum_Int64,ArraySum_Integer,ArraySum_Single,ArraySum_UInt64
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=636.dat
+DelphiXE=Y
+Delphi11A=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[ArraySum_Double]
+DisplayName="ArraySum (Double overload)"
+DescEx="Returns the sum of all Double floating point elements of array A .
0.0 is returned if the array is empty.
"
+Extra="This routine duplicates the functionality of Delphi's Math.SUM routine, but circumvents the access violation caused by Math.SUM in some circumstances.
"
+SeeAlso=ArraySum_Cardinal,ArraySum_Extended,ArraySum_Int64,ArraySum_Integer,ArraySum_Single,ArraySum_UInt64
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=637.dat
+DelphiXE=Y
+Delphi11A=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[ArraySum_Extended]
+DisplayName="ArraySum (Extended overload)"
+DescEx="Returns the sum of all Extended floating point elements of array A .
0.0 is returned if the array is empty.
"
+Extra="This routine duplicates the functionality of Delphi's Math.SUM routine, but circumvents the access violation caused by Math.SUM in some circumstances.
"
+SeeAlso=ArraySum_Cardinal,ArraySum_Double,ArraySum_Int64,ArraySum_Integer,ArraySum_Single,ArraySum_UInt64
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=638.dat
+DelphiXE=Y
+Delphi11A=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[ArraySum_Int64]
+DisplayName="ArraySum (Int64 overload)"
+DescEx="Returns the sum of all Int64 elements of array A .
0 is returned if the array is empty.
"
+SeeAlso=ArraySum_Cardinal,ArraySum_Double,ArraySum_Extended,ArraySum_Integer,ArraySum_Single,ArraySum_UInt64
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=639.dat
+DelphiXE=Y
+Delphi11A=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[ArraySum_Integer]
+DisplayName="ArraySum (Integer overload)"
+DescEx="Returns the sum of all Integer elements of array A .
0 is returned if the array is empty.
"
+SeeAlso=ArraySum_Cardinal,ArraySum_Double,ArraySum_Extended,ArraySum_Int64,ArraySum_Single,ArraySum_UInt64
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=640.dat
+DelphiXE=Y
+Delphi11A=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[ArraySum_Single]
+DisplayName="ArraySum (Single overload)"
+DescEx="Returns the sum of all Single floating point elements of array A .
0.0 is returned if the array is empty.
"
+Extra="This routine duplicates the functionality of Delphi's Math.SUM routine, but circumvents the access violation caused by Math.SUM in some circumstances.
"
+SeeAlso=ArraySum_Cardinal,ArraySum_Double,ArraySum_Extended,ArraySum_Int64,ArraySum_Integer,ArraySum_UInt64
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=641.dat
+DelphiXE=Y
+Delphi11A=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[ArraySum_UInt64]
+DisplayName="ArraySum (UInt64 overload)"
+DescEx="Returns the sum of all UInt64 elements of array A .
0 is returned if the array is empty.
"
+SeeAlso=ArraySum_Cardinal,ArraySum_Double,ArraySum_Extended,ArraySum_Int64,ArraySum_Integer,ArraySum_Single
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=642.dat
+DelphiXE=Y
+Delphi11A=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[DigitCount]
+DescEx="Counts the number of digits in the given integer.
"
+Extra="Contributed by Bill Miller.
"
+SeeAlso=DigitCount2,DigitCountR,DigitCountBase
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=202.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[DigitCount2]
+DescEx="Counts the number of digits in the given integer.
"
+Extra="Based on code suggested by Don Rowlett.
"
+Units=Math
+SeeAlso=DigitCount,DigitCountR,DigitCountBase
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=204.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[DigitCountR]
+DescEx="Counts the number of digits in the given integer using recursion.
"
+Extra="Contributed by Rubem Nascimento da Rocha.
"
+SeeAlso=DigitCount,DigitCount2,DigitCountBase
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=417.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[Factorial]
+DescEx="Calculates the factorial of the given number.
"
+Extra="Adapted from code contributed by Don Rowlett.
"
+Snip=231.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[IsRectNormal]
+DescEx="Checks if the given rectangle is normalized, i.e. Left <= Right and Top <= Bottom .
"
+Units=Windows
+SeeAlso=NormalizeRect
+Snip=124.dat
+Delphi2=Y
+Delphi3=Y
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[MoveRectToOrigin]
+DescEx="Translates the give rectangle to the origin.
The top and left co-ordinates are set to zero and the bottom and right co-ordinates are adjusted accordingly.
"
+Units=Types
+Snip=373.dat
+Delphi2=N
+Delphi3=N
+Delphi4=N
+Delphi5=Q
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[NormalizeRect]
+DescEx="Normalises the given rectangle so that Left <= Right and Top <= Bottom .
"
+Extra="Inspired by code published by Marco Cantù in supplementary chapter 22 of Mastering Delphi 5.
"
+Units=Windows
+Depends=ExchangeInt
+SeeAlso=IsRectNormal
+Snip=125.dat
+Delphi2=Y
+Delphi3=Y
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[RectArea]
+DescEx="Returns the area of the given rectangle.
"
+Extra="Adopts the convention that the rectangle's bottom and right are not included in it, so that width = right - left and height = bottom - top.
"
+SeeAlso=RectHeight,RectSize,RectWidth
+Units=Windows
+Snip=496.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[RectHeight]
+DescEx="Returns the height of the given rectangle.
The return value is always non-negative even if the rectangle is not normalized.
"
+Extra="Adopts the convention that the rectangle's bottom and right are not included in it, so that height = bottom - top.
"
+Units=Windows
+SeeAlso=RectSize,RectWidth,NormalizeRect
+Snip=127.dat
+Delphi2=Y
+Delphi3=Y
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[RectSize]
+DescEx="Returns the size of the given rectangle.
The returned dimensions are always non-negative even if the rectangle is not normalized.
"
+Extra="Adopts the convention that the rectangle's bottom and right are not included in it, so that width = right - left and height = bottom - top.
"
+Units=Windows
+Depends=RectWidth,RectHeight
+SeeAlso=RectWidth,RectHeight,NormalizeRect
+Snip=128.dat
+Delphi2=Y
+Delphi3=Y
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[RectWidth]
+DescEx="Returns the width of the given rectangle.
The return value is always non-negative even if the rectangle is not normalized.
"
+Extra="Adopts the convention that the rectangle's bottom and right are not included in it, so that width = right - left.
"
+Units=Windows
+SeeAlso=RectSize,RectHeight,NormalizeRect
+Snip=126.dat
+Delphi2=Y
+Delphi3=Y
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[RepeatedDigits]
+DescEx="Checks if the given integer contains only a single repeated digit.
"
+Extra="An example of an integer with a single repeated digit is 5555.
Slightly modified from code contributed by Rubem Rocha.
"
+Units=SysUtils,Math
+SeeAlso=AllDigitsSame
+Snip=497.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[ReverseNumber]
+DescEx="Reverses the digits of integer AValue and returns the resulting value.
AValue should be positive: zero is always returned for negative integers.
"
+Extra="Contributed by Rubem Nascimento da Rocha.
"
+SeeAlso=ReverseNumberR
+Snip=405.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[SignOfFloat]
+DescEx="Returns the sign of the given floating point value. Returns -1 if the value is positive, 0 if zero or +1 if negative.
"
+Extra="Contributed by Bill Miller.
"
+SeeAlso=SignOfInt
+Snip=205.dat
+Delphi2=Y
+Delphi3=Y
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[SignOfInt]
+DescEx="Returns the sign of the given integer. Returns -1 if the integer is positive, 0 if zero or +1 if negative.
"
+Extra="Contributed by Bill Miller.
"
+SeeAlso=SignOfFloat
+Snip=206.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[SumOfLogs_Cardinal]
+DisplayName=SumOfLogs (Cardinal overload)
+DescEx="Returns the sum of the natural logarithms of each Cardinal element of array A .
All elements of A must be positive. An exception is raised otherwise.
0 is returned if A is empty.
"
+SeeAlso=SumOfLogs_Double,SumOfLogs_Extended,SumOfLogs_Int64,SumOfLogs_Integer,SumOfLogs_Single,SumOfLogs_UInt64
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Units=SysUtils
+Snip=643.dat
+DelphiXE=Y
+Delphi11A=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[SumOfLogs_Double]
+DisplayName=SumOfLogs (Double overload)
+DescEx="Returns the sum of the natural logarithms of each Double floating point element of array A .
All elements of A must be positive. An exception is raised otherwise.
0.0 is returned if A is empty.
"
+SeeAlso=SumOfLogs_Cardinal,SumOfLogs_Extended,SumOfLogs_Int64,SumOfLogs_Integer,SumOfLogs_Single,SumOfLogs_UInt64
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Units=SysUtils,Math
+Snip=647.dat
+DelphiXE=Y
+Delphi11A=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[SumOfLogs_Extended]
+DisplayName=SumOfLogs (Extended overload)
+DescEx="Returns the sum of the natural logarithms of each Extended floating point element of array A .
All elements of A must be positive. An exception is raised otherwise.
0.0 is returned if A is empty.
"
+SeeAlso=SumOfLogs_Cardinal,SumOfLogs_Double,SumOfLogs_Int64,SumOfLogs_Integer,SumOfLogs_Single,SumOfLogs_UInt64
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Units=SysUtils,Math
+Snip=648.dat
+DelphiXE=Y
+Delphi11A=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[SumOfLogs_Int64]
+DisplayName=SumOfLogs (Int64 overload)
+DescEx="Returns the sum of the natural logarithms of each Int64 element of array A .
All elements of A must be positive. An exception is raised otherwise.
0 is returned if A is empty.
"
+SeeAlso=SumOfLogs_Cardinal,SumOfLogs_Double,SumOfLogs_Extended,SumOfLogs_Integer,SumOfLogs_Single,SumOfLogs_UInt64
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Units=SysUtils
+Snip=644.dat
+DelphiXE=Y
+Delphi11A=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[SumOfLogs_Integer]
+DisplayName=SumOfLogs (Integer overload)
+DescEx="Returns the sum of the natural logarithms of each Integer element of array A .
All elements of A must be positive. An exception is raised otherwise.
0 is returned if A is empty.
"
+SeeAlso=SumOfLogs_Cardinal,SumOfLogs_Double,SumOfLogs_Extended,SumOfLogs_Int64,SumOfLogs_Single,SumOfLogs_UInt64
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Units=SysUtils
+Snip=645.dat
+DelphiXE=Y
+Delphi11A=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[SumOfLogs_Single]
+DisplayName=SumOfLogs (Single overload)
+DescEx="Returns the sum of the natural logarithms of each Single floating point element of array A .
All elements of A must be positive. An exception is raised otherwise.
0.0 is returned if A is empty.
"
+SeeAlso=SumOfLogs_Cardinal,SumOfLogs_Double,SumOfLogs_Extended,SumOfLogs_Int64,SumOfLogs_Integer,SumOfLogs_UInt64
+Units=SysUtils,Math
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=649.dat
+DelphiXE=Y
+Delphi11A=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[SumOfLogs_UInt64]
+DisplayName=SumOfLogs (UInt64 overload)
+DescEx="Returns the sum of the natural logarithms of each UInt64 element of array A .
All elements of A must be positive. An exception is raised otherwise.
0 is returned if A is empty.
"
+SeeAlso=SumOfLogs_Cardinal,SumOfLogs_Double,SumOfLogs_Extended,SumOfLogs_Int64,SumOfLogs_Integer,SumOfLogs_Single
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Units=SysUtils
+Snip=646.dat
+DelphiXE=Y
+Delphi11A=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[DecimalToFraction]
+DescEx="Converts the given decimal to a fraction. The numerator and denominator are passed out as floating point numbers in FractionNumerator and FractionDenominator respectively.
AccuracyFactor determines how accurate the conversion is to be.
"
+Extra="Examples of AccuracyFactor values: 0.0005 requires accuracy of 3 decimal places and 0.000005 requires accuracy of 5 decimal places.
Adapted from the Turbo Pascal code by John Kennedy, Mathematics Department, Santa Monica College.
"
+Units=SysUtils,Math
+Snip=468.dat
+Delphi2=N
+Delphi3=N
+Delphi4=N
+Delphi5=N
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[DigitSum]
+DescEx="Returns the sum of the digits from the given integer, using recursion.
"
+Extra="Sums of digits of negative numbers are negative, for example DigitSum(-42)=-6 .
Contributed Rubem Nascimento da Rocha.
"
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+SeeAlso=DigitSumBase,DigitPowerSum
+Snip=418.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[DistanceBetweenPoints_Float]
+DisplayName="DistanceBetweenPoints (TPointF overload)"
+DescEx="Calculates the distance between two given points with double precision floating point valued coordinates.
"
+Depends=TPointF
+SeeAlso=DistanceBetweenPoints_Int
+Units=Math
+Snip=495.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[DistanceBetweenPoints_Int]
+DisplayName="DistanceBetweenPoints (TPoint overload)"
+DescEx="Calculates the distance between two points with integer valued co-ordinates.
"
+SeeAlso=DistanceBetweenPoints_Float
+Units=Math,Types
+Snip=494.dat
+Delphi2=N
+Delphi3=N
+Delphi4=N
+Delphi5=N
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[GCD]
+DescEx="Determines the greatest common divisor of two given non-zero integers.
"
+Extra="Uses Euclid's method.
Note that GCD(a,b) = GCD(|a|,b) = GCD(a,|b|) = GCD(|a|,|b|) , which implies that GCD(a,b) is always positive.
Modified from code by Hans van Kruijssen.
"
+SeeAlso=GCD2,LCD
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=201.dat
+Delphi2=Y
+Delphi3=Y
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[GCD2]
+DescEx="Determines the greatest common divisor of two given non-zero integers.
"
+Extra="Uses a recursive implementation of Euclid's method.
Note that GCD2(a,b) = GCD2(|a|,b) = GCD2(a,|b|) = GCD2(|a|,|b|) , which implies that GCD2(a,b) is always positive.
Modified from code by Hans van Kruijssen.
"
+SeeAlso=GCD,LCD
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=416.dat
+Delphi2=Y
+Delphi3=Y
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[IsPrime]
+DescEx="Checks if the given number is prime.
"
+Extra="On versions of Delphi that support Int64 parameters to the Sqrt function, the type of N , Max & Divisor can be changed to Int64 .
Adapted from code contributed by Don Rowlett.
"
+SeeAlso=IsPrime2
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=232.dat
+Delphi2=Y
+Delphi3=Y
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[IsPrime2]
+DescEx="Checks if the given number is prime.
"
+Extra="Uses less code than IsPrime and does not require any floating point operations.
Contributed by daniel.
"
+SeeAlso=IsPrime
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=570.dat
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[LCD]
+DescEx="Returns the least common divisor of two given non-zero integers.
"
+Extra="Note that LCD(a,b) = LCD(|a|,b) = LCD(a,|b|) = LCD(|a|,|b|) , which implies that LCD(a,b) is always positive.
Modified from code by Hans van Kruijssen.
"
+Depends=GCD
+SeeAlso=GCD,GCD2
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=467.dat
+Delphi2=Y
+Delphi3=Y
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[MaxOfArray_Double]
+DisplayName="MaxOfArray (Double overload)"
+DescEx="Returns the maximum value contained in the given array of double precision floating point values.
The array must not be empty.
"
+SeeAlso=MinOfArray_Double,MaxOfArray_Extended,MaxOfArray_Int64,MaxOfArray_Integer,MaxOfArray_Single,Mid_Double,MinMidMax_Double
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=428.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[MaxOfArray_Extended]
+DisplayName="MaxOfArray (Extended overload)"
+DescEx="Returns the maximum value contained in the given array of extended precision floating point values.
The array must not be empty.
"
+SeeAlso=MinOfArray_Extended,MaxOfArray_Double,MaxOfArray_Int64,MaxOfArray_Integer,MaxOfArray_Single,Mid_Extended,MinMidMax_Extended
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=429.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[MaxOfArray_Int64]
+DisplayName="MaxOfArray (Int64 overload)"
+DescEx="Returns the maximum value contained in the given array of 64 bit integer values.
The array must not be empty.
"
+SeeAlso=MinOfArray_Int64,MaxOfArray_Double,MaxOfArray_Extended,MaxOfArray_Integer,MaxOfArray_Single,Mid_Int64,MinMidMax_Int64
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=430.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[MaxOfArray_Integer]
+DisplayName="MaxOfArray (Integer overload)"
+DescEx="Returns the maximum value contained in the given array of integer values.
The array must not be empty.
"
+SeeAlso=MinOfArray_Integer,MaxOfArray_Double,MaxOfArray_Extended,MaxOfArray_Int64,MaxOfArray_Single,Mid_Integer,MinMidMax_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=431.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[MaxOfArray_Single]
+DisplayName="MaxOfArray (Single overload)"
+DescEx="Returns the maximum value contained in the given array of single precision floating point values.
The array must not be empty.
"
+SeeAlso=MinOfArray_Single,MaxOfArray_Double,MaxOfArray_Extended,MaxOfArray_Int64,MaxOfArray_Integer,Mid_Single,MinMidMax_Single
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=432.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[Mid_Double]
+DisplayName="Mid (Double overload)"
+DescEx="Returns the middle of three double precision floating point values.
"
+Units=Math
+SeeAlso=Mid_Extended,Mid_Int64,Mid_Integer,Mid_Single,MaxOfArray_Double,MinOfArray_Double,MinMidMax_Double
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=423.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[Mid_Extended]
+DisplayName="Mid (Extended overload)"
+DescEx="Returns the middle of three extended precision floating point values.
"
+Extra="Adapted from code from Bill Miller's snippets collection.
"
+Units=Math
+SeeAlso=Mid_Double,Mid_Int64,Mid_Integer,Mid_Single,MaxOfArray_Extended,MinOfArray_Extended,MinMidMax_Extended
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=424.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[Mid_Int64]
+DisplayName="Mid (Int64 overload)"
+DescEx="Returns the middle of three 64 bit integer values.
"
+Units=Math
+SeeAlso=Mid_Double,Mid_Extended,Mid_Integer,Mid_Single,MaxOfArray_Int64,MinOfArray_Int64,MinMidMax_Int64
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=425.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[Mid_Integer]
+DisplayName="Mid (Integer overload)"
+DescEx="Returns the middle of three integer values.
"
+Extra="Adapted from code from Bill Miller's snippets collection.
"
+Units=Math
+SeeAlso=Mid_Double,Mid_Extended,Mid_Int64,Mid_Single,MaxOfArray_Integer,MinOfArray_Integer,MinMidMax_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=426.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[Mid_Single]
+DisplayName="Mid (Single overload)"
+DescEx="Returns the middle of three single precision floating point values.
"
+Units=Math
+SeeAlso=Mid_Double,Mid_Extended,Mid_Int64,Mid_Integer,MaxOfArray_Single,MinOfArray_Single,MinMidMax_Single
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=427.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[MinMidMax_Double]
+DisplayName="MinMidMax (Double overload)"
+DescEx="Finds the minimum, middle and maximum values of three double precision floating point numbers, A , B and C and returns them in Min , Mid and Max respectively.
"
+Extra="Contributed by Bruce Wernick.
"
+SeeAlso=MinMidMax_Extended,MinMidMax_Int64,MinMidMax_Integer,MinMidMax_Single,Mid_Double,MaxOfArray_Double,MinOfArray_Double
+Snip=472.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[MinMidMax_Extended]
+DisplayName="MinMidMax (Extended overload)"
+DescEx="Finds the minimum, middle and maximum values of three extended precision floating point numbers, A , B and C and returns them in Min , Mid and Max respectively.
"
+Extra="Adapted from code contributed by Bruce Wernick.
"
+SeeAlso=MinMidMax_Double,MinMidMax_Int64,MinMidMax_Integer,MinMidMax_Single,Mid_Extended,MaxOfArray_Extended,MinOfArray_Extended
+Snip=473.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[MinMidMax_Int64]
+DisplayName="MinMidMax (Int64 overload)"
+DescEx="Finds the minimum, middle and maximum values of three 64 bit integers, A , B and C and returns them in Min , Mid and Max respectively.
"
+Extra="Adapted from code contributed by Bruce Wernick.
"
+SeeAlso=MinMidMax_Double,MinMidMax_Extended,MinMidMax_Integer,MinMidMax_Single,Mid_Int64,MaxOfArray_Int64,MinOfArray_Int64
+Snip=474.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[MinMidMax_Integer]
+DisplayName="MinMidMax (Integer overload)"
+DescEx="Finds the minimum, middle and maximum values of three integers, A , B and C and returns them in Min , Mid and Max respectively.
"
+Extra="Adapted from code contributed by Bruce Wernick.
"
+SeeAlso=MinMidMax_Double,MinMidMax_Extended,MinMidMax_Int64,MinMidMax_Single,Mid_Integer,MaxOfArray_Integer,MinOfArray_Integer
+Snip=475.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[MinMidMax_Single]
+DisplayName="MinMidMax (Single overload)"
+DescEx="Finds the minimum, middle and maximum values of three single precision floating point numbers, A , B and C and returns them in Min , Mid and Max respectively.
"
+Extra="Adapted from code contributed by Bruce Wernick.
"
+SeeAlso=MinMidMax_Double,MinMidMax_Extended,MinMidMax_Int64,MinMidMax_Integer,Mid_Single,MaxOfArray_Single,MinOfArray_Single
+Snip=476.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[MinOfArray_Double]
+DisplayName="MinOfArray (Double overload)"
+DescEx="Returns the minimum value contained in the given array of double precision floating point values.
The array must not be empty.
"
+SeeAlso=MaxOfArray_Double,MinOfArray_Extended,MinOfArray_Int64,MinOfArray_Integer,MinOfArray_Single,Mid_Double,MinMidMax_Double
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=433.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[MinOfArray_Extended]
+DisplayName="MinOfArray (Extended overload)"
+DescEx="Returns the minimum value contained in the given array of extended precision floating point values.
The array must not be empty.
"
+SeeAlso=MaxOfArray_Extended,MinOfArray_Double,MinOfArray_Int64,MinOfArray_Integer,MinOfArray_Single,Mid_Extended,MinMidMax_Extended
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=434.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[MinOfArray_Int64]
+DisplayName="MinOfArray (Int64 overload)"
+DescEx="Returns the minimum value contained in the given array of 64 bit integer values.
The array must not be empty.
"
+SeeAlso=MaxOfArray_Int64,MinOfArray_Double,MinOfArray_Extended,MinOfArray_Integer,MinOfArray_Single,Mid_Int64,MinMidMax_Int64
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=435.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[MinOfArray_Integer]
+DisplayName="MinOfArray (Integer overload)"
+DescEx="Returns the minimum value contained in the given array of integer values.
The array must not be empty.
"
+SeeAlso=MaxOfArray_Integer,MinOfArray_Double,MinOfArray_Extended,MinOfArray_Int64,MinOfArray_Single,Mid_Integer,MinMidMax_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=436.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[MinOfArray_Single]
+DisplayName="MinOfArray (Single overload)"
+DescEx="Returns the minimum value contained in the given array of single precision floating point values.
The array must not be empty.
"
+SeeAlso=MaxOfArray_Single,MinOfArray_Double,MinOfArray_Extended,MinOfArray_Int64,MinOfArray_Integer,Mid_Single,MinMidMax_Single
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=437.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[NormaliseFractionSign]
+DescEx="Normalises the sign of the fraction with numerator Num and denominator Denom so that Num takes the sign of the fraction and Denom is non-negative.
"
+SeeAlso=FractionToStr,FractionToStrEx
+Snip=559.dat
+Delphi2=Y
+Delphi3=Y
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[Pow]
+DescEx="Raises integer value Base to non-negative integer power Exponent and returns the result.
"
+SeeAlso=PowN,PowNZN,PowNZZ
+Snip=561.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[PowN]
+DescEx="IEEE compliant function that raises real number X to the power N .
"
+Extra="See IEEE standard 754-2008 for Floating-Point Arithmetic, page 44.
"
+Units=SysUtils,Math
+SeeAlso=Pow,PowNZN,PowNZZ
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=633.dat
+DelphiXE=Y
+Delphi11A=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[PowNZN]
+DescEx="Raises integer X to non-negative integer power N .
If the result is too large to be represented as an Int64 value then an EOverflow exception is raised.
"
+Extra="Returns an integer value because the power N is non-negative which guarantees that the result is integral.
Based on IEEE standard 754-2008 for Floating-Point Arithmetic, page 44, but which restricts X to an integer and N to a non-negative integer.
"
+Units=SysUtils
+SeeAlso=Pow,PowN,PowNZZ
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=634.dat
+DelphiXE=Y
+Delphi11A=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[PowNZZ]
+DescEx="Raises integer X to integer power N .
"
+Extra="Returns an Extended value since the result is not an integer when power N is negative.
Based on IEEE standard 754-2008 for Floating-Point Arithmetic, page 44, but which restricts X to an integer.
"
+Units=SysUtils,
+SeeAlso=Pow,PowN,PowNZN
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=635.dat
+DelphiXE=Y
+Delphi11A=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[ResizeRect_A]
+DisplayName="ResizeRect (TSize overload)"
+DescEx="Resizes rectangle R to size NewSize , leaving the top-left position unchanged.
Returns the resized rectangle.
"
+Units=Types
+Depends=ResizeRect_B
+SeeAlso=ResizeRect_B,StretchRect_A,StretchRect_B,ScaleRect,ZoomRatio_A,ZoomRatio_B,ZoomRatio_C
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=420.dat
+Delphi2=N
+Delphi3=N
+Delphi4=N
+Delphi5=N
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[ResizeRect_B]
+DisplayName="ResizeRect (Longint overload)"
+DescEx="Resizes rectangle R to the width and height given by NewWidth and NewHeight , leaving the top-left position unchanged.
Returns the resized rectangle.
"
+Units=Types
+SeeAlso=ResizeRect_A,StretchRect_A,StretchRect_B,ScaleRect,ZoomRatio_A,ZoomRatio_B,ZoomRatio_C
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=419.dat
+Delphi2=N
+Delphi3=N
+Delphi4=N
+Delphi5=N
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[ReverseNumberR]
+DescEx="Reverses the digits of the given integer, which must be non-negative, and returns the resulting value.
Uses recursion.
"
+Extra="Users of Delphi 7 and later can change the parameter and return type to UInt64 and remove the assertion.
Slightly modified from code contributed by Rubem Nascimento da Rocha.
"
+Units=Math
+SeeAlso=ReverseNumber
+Snip=406.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[SAR]
+DescEx="Performs an arithmetic right shift operation on the given value and returns the result. Value is shifted right by Shift bits.
Shift must be in the range 0..31 and is adjusted if it is not.
"
+Extra="SAR differs from the shr operator in that it preserves any sign bit.
For more information about the different kinds of right shift operator, see this blog post .
"
+Snip=560.dat
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[ScaleRect]
+DescEx="Scales the given rectangle by the given scale factor and returns the scaled rectangle.
"
+Extra="Slightly modified from code contributed by Montor.
"
+Units=Types
+SeeAlso=ZoomRatio_A,ZoomRatio_B,ZoomRatio_C,StretchRect_A,StretchRect_B,ResizeRect_A,ResizeRect_B
+Snip=383.dat
+Delphi2=N
+Delphi3=N
+Delphi4=N
+Delphi5=N
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[SimplifyFraction]
+DescEx="Simplifies the fraction with numerator Num and denominator Denom to its lowest terms.
If the fraction is already in its lowest terms then Num and Denom are left unchanged.
"
+Depends=GCD
+SeeAlso=DecimalToFraction,NormaliseFractionSign
+Snip=621.dat
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[StretchRect_A]
+DisplayName="StretchRect (asymmetric overload)"
+DescEx="Stretches rectangle R by the given scaling factors and returns the result.
The rectangle's width is scaled by ScalingX and its height by ScalingY .
The top left corner of the rectangle is not changed.
"
+Units=SysUtils,Types
+SeeAlso=StretchRect_B,ScaleRect,ResizeRect_A,ResizeRect_B,ZoomRatio_A,ZoomRatio_B,ZoomRatio_C
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=421.dat
+Delphi2=N
+Delphi3=N
+Delphi4=N
+Delphi5=N
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[StretchRect_B]
+DisplayName="StretchRect (symmetric overload)"
+DescEx="Stretches the rectangle R by scale factor Scaling and returns the result. Both width and height are stretched by the same scale factor.
The top left corner is not changed.
"
+Units=Types
+Depends=StretchRect_A
+SeeAlso=StretchRect_A,ScaleRect,ResizeRect_A,ResizeRect_B,ZoomRatio_A,ZoomRatio_B,ZoomRatio_C
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=422.dat
+Delphi2=N
+Delphi3=N
+Delphi4=N
+Delphi5=N
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[ZoomRatio_A]
+DisplayName="ZoomRatio (Integer overload)"
+DescEx="Calculates and returns the largest scaling that can be applied to a rectangle of width SrcWidth and height SrcHeight to fit it, without changing the aspect ratio, within a second rectangle of width DestWidth and height DestHeight .
"
+Extra="Slightly modified from code contributed by Montor.
"
+Units=Math
+SeeAlso=ZoomRatio_B,ZoomRatio_C,ScaleRect,StretchRect_A,StretchRect_B,ResizeRect_A,ResizeRect_B
+Snip=376.dat
+Delphi2=N
+Delphi3=N
+Delphi4=Y
+Delphi5=Y
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[ZoomRatio_B]
+DisplayName="ZoomRatio (TSize overload)"
+DescEx="Calculates and returns the largest scaling that can be applied to a rectangle of size SrcSize to fit it, without changing the aspect ratio, within a second rectangle of size DestSize .
"
+Units=Types
+Depends=ZoomRatio_A
+SeeAlso=ZoomRatio_A,ZoomRatio_C,ScaleRect,StretchRect_A,StretchRect_B,ResizeRect_A,ResizeRect_B
+Snip=377.dat
+Delphi2=N
+Delphi3=N
+Delphi4=N
+Delphi5=N
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[ZoomRatio_C]
+DisplayName="ZoomRatio (TRect overload)"
+DescEx="Calculates and returns the largest scaling that can be applied to rectangle SrcRect to fit it, without changing the aspect ratio, within rectangle DestRect .
"
+Units=Types
+Depends=RectSize,ZoomRatio_B
+SeeAlso=ZoomRatio_A,ZoomRatio_B,ScaleRect,StretchRect_A,StretchRect_B,ResizeRect_A,ResizeRect_B
+Snip=378.dat
+Delphi2=N
+Delphi3=N
+Delphi4=N
+Delphi5=N
+Delphi6=Y
+Delphi7=Y
+Delphi2005Win32=Y
+Delphi2006Win32=Y
+Delphi2007=Y
+Delphi2009Win32=Y
+Delphi2010=Y
+DelphiXE=Y
+DelphiXE2=Y
+DelphiXE3=Y
+DelphiXE4=Y
+Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
+FPC=Y
+
+[ArithmeticMean_Double]
+DisplayName="ArithmeticMean (Double overload)"
+DescEx="Returns the arithmetic mean of an array of Double values.
EArgumentException is raised if the array is empty.
"
+Units=SysUtils
+SeeAlso=ArithmeticMean_Integer,ArithmeticMean_Cardinal,WeightedArithmeticMean_Double,GeometricMean_Double,HarmonicMean_Double,PowerMean_Double,LogarithmicMean,Median_Double,Mode,ModeAlt
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=650.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[ArithmeticMean_Integer]
+DisplayName="ArithmeticMean (Integer overload)"
+DescEx="Returns the arithmetic mean of an array of Integer values.
EArgumentException is raised if the array is empty.
"
+Units=SysUtils
+SeeAlso=ArithmeticMean_Double,ArithmeticMean_Cardinal,WeightedArithmeticMean_Integer,GeometricMean_Integer,HarmonicMean_Integer,PowerMean_Integer,Median_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=651.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[ArithmeticMean_Cardinal]
+DisplayName="ArithmeticMean (Cardinal overload)"
+DescEx="Returns the arithmetic mean of an array of Cardinal values.
EArgumentException is raised if the array is empty.
"
+Units=SysUtils
+SeeAlso=ArithmeticMean_Double,ArithmeticMean_Integer,WeightedArithmeticMean_Cardinal,GeometricMean_Cardinal,HarmonicMean_Cardinal,PowerMean_Cardinal
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=652.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[WeightedArithmeticMean_Double]
+DisplayName="WeightedArithmeticMean (Double overload)"
+DescEx="Calculates and returns the weighted average of the Double elements of array Values where each element is weighted by the corresponding element in the array Weights .
An EArgumentException exception is raised if any of the following pre-conditions are not met: Values must be non-empty; Values & Weights must have the same number of elements; all elements of Weights must be non-negative, with at least one element being non-zero.
"
+Units=SysUtils,Math
+SeeAlso=ArithmeticMean_Double,WeightedArithmeticMean_Integer,WeightedArithmeticMean_Cardinal,WeightedGeometricMean_Double,WeightedHarmonicMean_Double,WeightedPowerMean_Double,LogarithmicMean
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=653.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[WeightedArithmeticMean_Integer]
+DisplayName="WeightedArithmeticMean (Integer overload)"
+DescEx="Calculates and returns the weighted average of the Integer elements of array Values where each element is weighted by the corresponding element in the array Weights .
An EArgumentException exception is raised if any of the following pre-conditions are not met: Values must be non-empty; Values & Weights must have the same number of elements; all elements of Weights must be non-negative, with at least one element being non-zero.
"
+Units=
+Depends=WeightedArithmeticMean_Double
+SeeAlso=ArithmeticMean_Integer,WeightedArithmeticMean_Double,WeightedArithmeticMean_Cardinal,WeightedGeometricMean_Integer,WeightedHarmonicMean_Integer,WeightedPowerMean_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=654.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[WeightedArithmeticMean_Cardinal]
+DisplayName="WeightedArithmeticMean (Cardinal overload)"
+DescEx="Calculates and returns the weighted average of the Cardinal elements of array Values where each element is weighted by the corresponding element in the array Weights .
An EArgumentException exception is raised if any of the following pre-conditions are not met: Values must be non-empty; Values & Weights must have the same number of elements; all elements of Weights must be non-negative, with at least one element being non-zero.
"
+Units=
+Depends=WeightedArithmeticMean_Double
+SeeAlso=ArithmeticMean_Cardinal,WeightedArithmeticMean_Double,WeightedArithmeticMean_Integer,WeightedGeometricMean_Cardinal,WeightedHarmonicMean_Cardinal,WeightedPowerMean_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=655.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[DigitSumBase]
+DisplayName="DigitSumBase"
+DescEx="Calculates the sum of all the digits of integer N when epxressed in base Base . The returned value has the same sign as N .
Bases up to 255 are supported. If Base < 2 then an EArgumentException exception is raised.
"
+Kind=routine
+Units=SysUtils,Math
+SeeAlso=DigitSum,DigitPowerSum
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=657.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[DigitCountBase]
+DisplayName="DigitCountBase"
+DescEx="Returns the number of digits in integer N when expressed in base Base .
Bases up to 255 are supported. If Base < 2 then an EArgumentException exception is raised.
"
+Extra="The number of digits of an integer n > 0 in base b >= 2 can be expressed mathematically as:
floor(logb (n )) + 1
Unfortunately testing a Pascal implementation of this formula failed on some tests, e.g. DigitCount($FFFFFFFF,16) . This was probably due to floating point rounding errors. Therefore this implementation using only integer operations was used instead.
"
+Kind=routine
+Units=SysUtils
+SeeAlso=DigitCount,DigitCount2,DigitCountR
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=658.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[DigitsOf]
+DisplayName=DigitsOf
+DescEx="Returns an array containing the digits of integer N when expressed in base Base . The array is ordered with the least significant digit first.
The returned array contains the decimal value of the digit, for e.g. the hex symbol F is represented by an array element containing the value 15 .
Bases up to 255 are supported. If Base < 2 then an EArgumentException exception is raised.
"
+Extra="Examples:
1. DigitsOf($FACE,16) returns [15,10,12,14]
2. DigitsOf(12,8) returns [1,4]
3. DigitsOf(6,2) returns [1,1,0]
4. DigitsOf(6,10) returns [6]
5. DigitsOf(0,8) returns [0]
"
+Kind=routine
+Units=SysUtils
+Depends=DigitCountBase
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=659.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[DigitPowerSum]
+DisplayName=DigitPowerSum
+DescEx="Calculates the sum of all the digits of integer N in base Base where each digit is raised to the power Exponent . The returned value has the same sign as N .
If the result is too large to be represented as an Int64 value then an EOverflow exception is raised.
Bases up to 255 are supported. If Base <= 2 then an EArgumentException exception is raised.
"
+Kind=routine
+Units=SysUtils,Math
+Depends=PowNZN
+SeeAlso=DigitSum,DigitSumBase
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=661.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[IsPalindromic]
+DisplayName="IsPalindromic"
+DescEx="Checks if the absolute value of integer N is palindromic in base Base .
Bases up to 255 are supported. If Base < 2 then an EArgumentException exception is raised.
"
+Extra="A number expressed in a specified base is palindromic if it remains unchanged when its digits are reversed. See Wikipedia for a formal definition and examples.
Strictly speaking a palindromic number should be non-negative. However, IsPalindromic considers negative numbers to be palindromic if and only if their absolute value is palindromic.
"
+Kind=routine
+Units=SysUtils
+Depends=DigitsOf
+SeeAlso=IsNarcissistic
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=660.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[IsNarcissistic]
+DisplayName=IsNarcissistic
+DescEx="Checks if the absolute value of integer N is a narcissistic number in base Base .
Bases up to 255 are supported. If Base <= 2 then an EArgumentException exception is raised. An EOverflow exception may be raised for large numbers and bases.
"
+Extra="A narcissistic number in a given number base is a number that is the sum of its own digits each raised to the power of the number of digits. See Wikipedia for a formal definition and examples.
Strictly speaking a palindromic number should be non-negative. However, IsNarcissistic considers negative numbers to be narcissistic if and only if their absolute value is narcissistic.
"
+Kind=routine
+Depends=DigitCountBase,DigitPowerSum
+SeeAlso=IsPalindromic
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=662.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[LSE]
+DisplayName=LSE
+DescEx="Returns the logarithm of the sum of the exponentials of the given array of floating pointing point numbers.
An EArgumentException exception is raised if the array is empty.
"
+Extra="The mathematical definition of LSE is LSE(x1,...,xn) = log(exp(x1) + ... + exp(xn)) . The version of the algorithm used here uses an algebraic trick to minimise the risk of overflow.
For more information see What Is the Log-Sum-Exp Function? by Nick Higham.
"
+Kind=routine
+Units=SysUtils
+Depends=MaxOfArray_Double
+SeeAlso=Softmax
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=663.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[Softmax]
+DisplayName=Softmax
+DescEx="Applies the softmax function to each element of floating point array A and normalizes them into a probability distribution proportional to the exponentials of the elements of A . The normalised values are returned as an array of the same size as A .
An EArgumentException exception is raised if A is empty.
"
+Extra="The softmax function is often used in statistics and in machine learning. It is closely related to the log-sum-exp (aka LSE ) function since, for vector x =(x1,...,xn), softmax(x )=exp[x −LSE(x )] .
"
+Kind=routine
+Units=SysUtils,Types
+Depends=LSE
+SeeAlso=LSE,MaxOfArray_Double
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=664.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[Median_Double]
+DisplayName="Median (Double overload)"
+DescEx="Returns the median of an array of floating point values.
Raises an EArgumentException exception if the array is empty.
"
+Kind=routine
+Units=SysUtils,Generics.Collections
+SeeAlso=Median_Integer,ArithmeticMean_Double,GeometricMean_Double,HarmonicMean_Double,PowerMean_Double,LogarithmicMean,ModeAlt,Mode
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=665.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[Median_Integer]
+DisplayName="Median (Integer overload)"
+DescEx="Returns the median of an array of integer values.
Raises an EArgumentException exception if the array is empty.
"
+Kind=routine
+Units=SysUtils,Generics.Collections
+SeeAlso=Median_Double,ArithmeticMean_Integer,GeometricMean_Integer,HarmonicMean_Integer,PowerMean_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=666.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[MinMaxOfArray_Double]
+DisplayName="MinMaxOfArray (Double overload)"
+DescEx="Finds the minimum and maximum values contained in the non-empty array, A , of double precision floating point values. MinValue and MaxValue are set to the minimum and maximum values, respectively.
EArgumentException is raised if A is empty.
"
+Kind=routine
+Units=SysUtils
+SeeAlso=MinMaxOfArray_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=669.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[MinMaxOfArray_Integer]
+DisplayName="MinMaxOfArray (Integer overload)"
+DescEx="Finds the minimum and maximum values contained in the non-empty Integer array A . MinValue and MaxValue are set to the minimum and maximum values, respectively.
EArgumentException is raised if A is empty.
"
+Kind=routine
+Units=SysUtils
+SeeAlso=MinMaxOfArray_Double
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=670.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[RescaleRange_Double]
+DisplayName="RescaleRange (Double overload)"
+DescEx="Rescales the elements of array A containing a range of Double values so that each value of A is mapped to a value in the range [0..1].
An array of the same size as A is returned where each element contains the rescaled value of the corresponding element of A .
A must not be empty and not all elements may be the same value. EArgumentException is raised if either condition is not met.
"
+Kind=routine
+Units=SysUtils,Types,Math
+Depends=MinMaxOfArray_Double
+SeeAlso=NormaliseByWeight_Double,RescaleRange_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=667.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[RescaleRange_Integer]
+DisplayName="RescaleRange (Integer overload)"
+DescEx="Rescales the elements of array A containing a range of Integer values so that each value of A is mapped to a value in the range [0..1].
An array of the same size as A is returned where each element contains the rescaled value of the corresponding element of A .
A must not be empty and not all elements may be the same value. EArgumentException is raised if either condition is not met.
"
+Kind=routine
+Units=SysUtils,Types
+Depends=MinMaxOfArray_Integer
+SeeAlso=NormaliseByWeight_Cardinal,RescaleRange_Double
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=674.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[NormaliseByWeight_Double]
+DisplayName="NormaliseByWeight (Double overload)"
+DescEx="Normalises the values in floating point array A so that each value of A is mapped to a value in the range [0..1], where the total of all the values is 1. The relative weights of the values are preserved.
An array of the same size as A is returned where each element contains the normalised value of the corresponding element of A .
A must not be empty. All elements of A must be >= 0, with at least one element > 0. EArgumentException is raised if these conditions are not met.
"
+Kind=routine
+Units=SysUtils,Types,Math
+SeeAlso=RescaleRange_Double,NormaliseByWeight_Cardinal
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=668.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[NormaliseByWeight_Cardinal]
+DisplayName="NormaliseByWeight (Cardinal overload)"
+DescEx="Normalises the values in unsigned integer array A so that each value of A is mapped to a value in the range [0..1], where the total of all the values is 1. The relative weights of the values are preserved.
An array of the same size as A is returned where each element contains the normalised value of the corresponding element of A .
A must not be empty and must have at least one non-zero element. EArgumentException is raised if these conditions are not met.
"
+Kind=routine
+Units=SysUtils,Types
+SeeAlso=RescaleRange_Integer,NormaliseByWeight_Double
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=671.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[RangeOf_Double]
+DisplayName="RangeOf (Double overload)"
+DescEx="Returns the length of the range of values in non-empty Double array A .
EArgumentException is raised if A is empty.
"
+Kind=routine
+Units=Math
+Depends=MinMaxOfArray_Double
+SeeAlso=RangeOf_Integer,RescaleRange_Double
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=672.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[RangeOf_Integer]
+DisplayName="RangeOf (Integer overload)"
+DescEx="Returns the length of the range of values in non-empty Integer array A .
EArgumentException is raised if A is empty.
"
+Kind=routine
+Depends=MinMaxOfArray_Integer
+SeeAlso=RangeOf_Double,RescaleRange_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=673.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[GeometricMean_Double]
+DisplayName="GeometricMean (Double overload)"
+DescEx="Returns the geometric mean of an array of positive Double values.
EArgumentException is raised if the array is empty while EArgumentOutOfRangeException is raised if any array element is not positive.
"
+Extra="See Wikipedia for information about the geometric mean.
"
+Kind=routine
+Units=SysUtils
+Depends=SumOfLogs_Double
+SeeAlso=ArithmeticMean_Double,GeometricMean_Integer,GeometricMean_Cardinal,WeightedGeometricMean_Double,HarmonicMean_Double,PowerMean_Double,Median_Double,Mode,ModeAlt,LogarithmicMean
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=675.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[GeometricMean_Cardinal]
+DisplayName="GeometricMean (Cardinal overload)"
+DescEx="Returns the geometric mean of an array of positive Cardinal values.
EArgumentException is raised if the array is empty while EArgumentOutOfRangeException is raised if any array element is not positive.
"
+Extra="See Wikipedia for information about the geometric mean.
"
+Kind=routine
+Units=SysUtils
+Depends=SumOfLogs_Cardinal
+SeeAlso=ArithmeticMean_Cardinal,GeometricMean_Integer,GeometricMean_Double,WeightedGeometricMean_Cardinal,HarmonicMean_Cardinal,PowerMean_Cardinal
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=676.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[GeometricMean_Integer]
+DisplayName="GeometricMean (Integer overload)"
+DescEx="Returns the geometric mean of an array of positive Integer values.
EArgumentException is raised if the array is empty while EArgumentOutOfRangeException is raised if any array element is not positive.
"
+Extra="See Wikipedia for information about the geometric mean.
"
+Kind=routine
+Units=SysUtils
+Depends=SumOfLogs_Integer
+SeeAlso=ArithmeticMean_Integer,GeometricMean_Cardinal,GeometricMean_Double,WeightedGeometricMean_Integer,HarmonicMean_Integer,PowerMean_Integer,Median_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=677.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[WeightedGeometricMean_Double]
+DisplayName="WeightedGeometricMean (Double overload)"
+DescEx="Calculates and returns the weighted geometric mean of the array Values of positive Double values where each element is weighted by the corresponding element in the array Weights .
An EArgumentException exception is raised if any of the following pre-conditions are not met: Values must be non-empty; all elements of Values must be positive; Values & Weights must have the same number of elements; all elements of Weights must be non-negative, with at least one element being non-zero.
"
+Extra="See Wikipedia for information about the weighted geometric mean.
"
+Units=SysUtils,Types
+Depends=NormaliseByWeight_Double
+SeeAlso=GeometricMean_Double,WeightedArithmeticMean_Double,WeightedGeometricMean_Cardinal,WeightedGeometricMean_Integer,WeightedHarmonicMean_Double,WeightedPowerMean_Double
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=678.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[WeightedGeometricMean_Cardinal]
+DisplayName="WeightedGeometricMean (Cardinal overload)"
+DescEx="Calculates and returns the weighted geometric mean of the array Values of positive Cardinal values where each element is weighted by the corresponding element in the array Weights .
An EArgumentException exception is raised if any of the following pre-conditions are not met: Values must be non-empty; all elements of Values must be positive; Values & Weights must have the same number of elements; all elements of Weights must be non-negative, with at least one element being non-zero.
"
+Extra="See Wikipedia for information about the weighted geometric mean.
"
+Units=Types
+Depends=WeightedGeometricMean_Double
+SeeAlso=GeometricMean_Cardinal,WeightedArithmeticMean_Cardinal,WeightedGeometricMean_Double,WeightedGeometricMean_Integer,WeightedPowerMean_Cardinal, WeightedHarmonicMean_Cardinal
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=679.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[WeightedGeometricMean_Integer]
+DisplayName="WeightedGeometricMean (Integer overload)"
+DescEx="Calculates and returns the weighted geometric mean of the array Values of positive Integer values where each element is weighted by the corresponding element in the array Weights .
An EArgumentException exception is raised if any of the following pre-conditions are not met: Values must be non-empty; all elements of Values must be positive; Values & Weights must have the same number of elements; all elements of Weights must be non-negative, with at least one element being non-zero.
"
+Extra="See Wikipedia for information about the weighted geometric mean.
"
+Units=Types
+Depends=WeightedGeometricMean_Double
+SeeAlso=GeometricMean_Integer,WeightedArithmeticMean_Integer,WeightedGeometricMean_Double,WeightedGeometricMean_Cardinal,WeightedHarmonicMean_Integer,WeightedPowerMean_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=680.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[SumOfReciprocals_Double]
+DisplayName="SumOfReciprocals (Double overload)"
+DescEx="Calculates the sum of the reciprocal values of all elements of Double array A .
A must not be empty and all its elements must be positive. EArgumentException is raised if either of these conditions is not satisfied.
"
+Units=SysUtils,Math
+SeeAlso=SumOfReciprocals_Integer,SumOfReciprocals_Cardinal
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=681.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[SumOfReciprocals_Integer]
+DisplayName="SumOfReciprocals (Integer overload)"
+DescEx="Calculates the sum of the reciprocal values of all elements of Integer array A .
A must not be empty and all its elements must be positive. EArgumentException is raised if either of these conditions is not satisfied.
"
+Units=SysUtils
+SeeAlso=SumOfReciprocals_Integer,SumOfReciprocals_Double
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=682.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[SumOfReciprocals_Cardinal]
+DisplayName="SumOfReciprocals (Cardinal overload)"
+DescEx="Calculates the sum of the reciprocal values of all elements of Cardinal array A .
A must not be empty and all its elements must be positive. EArgumentException is raised if either of these conditions is not satisfied.
"
+Units=SysUtils
+SeeAlso=SumOfReciprocals_Double,SumOfReciprocals_Cardinal
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=683.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[HarmonicMean_Double]
+DisplayName="HarmonicMean (Double overload)"
+DescEx="Returns the harmonic mean of an array of positive Double values.
EArgumentException is raised if the array is empty or if any array element is not positive.
"
+Extra="See Wikipedia for information about the harmonic mean.
"
+Depends=SumOfReciprocals_Double
+SeeAlso=HarmonicMean_Integer,HarmonicMean_Cardinal,ArithmeticMean_Double,GeometricMean_Double,PowerMean_Double,Mode,ModeAlt,Median_Double,LogarithmicMean,WeightedHarmonicMean_Double
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=684.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[HarmonicMean_Cardinal]
+DisplayName="HarmonicMean (Cardinal overload)"
+DescEx="Returns the harmonic mean of an array of positive Cardinal values.
EArgumentException is raised if the array is empty or if any array element is not positive.
"
+Extra="See Wikipedia for information about the harmonic mean.
"
+Depends=SumOfReciprocals_Cardinal
+SeeAlso=HarmonicMean_Double,HarmonicMean_Integer,ArithmeticMean_Cardinal,GeometricMean_Cardinal,PowerMean_Cardinal,WeightedHarmonicMean_Cardinal
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=685.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[HarmonicMean_Integer]
+DisplayName="HarmonicMean (Integer overload)"
+DescEx="Returns the harmonic mean of an array of positive Integer values.
EArgumentException is raised if the array is empty or if any array element is not positive.
"
+Extra="See Wikipedia for information about the harmonic mean.
"
+Depends=SumOfReciprocals_Integer
+SeeAlso=HarmonicMean_Cardinal,HarmonicMean_Double,ArithmeticMean_Integer,GeometricMean_Integer,PowerMean_Integer,WeightedHarmonicMean_Integer,Median_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=686.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[WeightedHarmonicMean_Double]
+DisplayName="WeightedHarmonicMean (Double overload)"
+DescEx="Calculates and returns the weighted harmonic mean of the array Values of positive Double values where each element is weighted by the corresponding element in the array Weights .
An EArgumentException exception is raised if any of the following pre-conditions are not met: Values must be non-empty; all elements of Values must be positive; Values & Weights must have the same number of elements; all elements of Weights must be non-negative, with at least one element being non-zero.
"
+Extra="See Wikipedia for information about the weighted harmonic mean.
"
+Kind=routine
+Units=SysUtils,Types
+Depends=NormaliseByWeight_Double
+SeeAlso=HarmonicMean_Double,WeightedHarmonicMean_Cardinal,WeightedHarmonicMean_Integer,WeightedArithmeticMean_Double,WeightedGeometricMean_Double,WeightedPowerMean_Double
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=687.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[WeightedHarmonicMean_Cardinal]
+DisplayName="WeightedHarmonicMean (Cardinal overload)"
+DescEx="Calculates and returns the weighted harmonic mean of the array Values of positive Cardinal values where each element is weighted by the corresponding element in the array Weights .
An EArgumentException exception is raised if any of the following pre-conditions are not met: Values must be non-empty; all elements of Values must be positive; Values & Weights must have the same number of elements; all elements of Weights must be non-negative, with at least one element being non-zero.
"
+Extra="See Wikipedia for information about the weighted harmonic mean.
"
+Kind=routine
+Units=Types
+Depends=WeightedHarmonicMean_Double
+SeeAlso=HarmonicMean_Cardinal,WeightedHarmonicMean_Double,WeightedHarmonicMean_Integer,WeightedArithmeticMean_Cardinal,WeightedGeometricMean_Cardinal,WeightedPowerMean_Cardinal
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=688.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[WeightedHarmonicMean_Integer]
+DisplayName="WeightedHarmonicMean (Integer overload)"
+DescEx="Calculates and returns the weighted harmonic mean of the array Values of positive Integer values where each element is weighted by the corresponding element in the array Weights .
An EArgumentException exception is raised if any of the following pre-conditions are not met: Values must be non-empty; all elements of Values must be positive; Values & Weights must have the same number of elements; all elements of Weights must be non-negative, with at least one element being non-zero.
"
+Extra="See Wikipedia for information about the weighted harmonic mean.
"
+Kind=routine
+Units=Types
+Depends=WeightedHarmonicMean_Double
+SeeAlso=HarmonicMean_Integer,WeightedHarmonicMean_Double,WeightedHarmonicMean_Cardinal,WeightedArithmeticMean_Integer,WeightedGeometricMean_Integer,WeightedPowerMean_Integer,Median_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=689.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[LogarithmicMean]
+DisplayName="LogarithmicMean"
+DescEx="Returns the logarithmic mean of two positive floating point values, X and Y .
Raises EArgumentException if either X or Y is not positive.
"
+Extra="See Chemepedia for information about the logarithmic mean.
"
+Kind=routine
+Units=SysUtils,Math
+SeeAlso=ArithmeticMean_Double,GeometricMean_Double,HarmonicMean_Double,PowerMean_Double,Median_Double,Mode,ModeAlt
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=690.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[PowerMean_Double]
+DisplayName="PowerMean (Double overload)"
+DescEx="Returns the power mean of the elements of Double array Values , with exponent Lambda .
An EArgumentException is raised if the array is empty, if any array element is negative or if Lambda is zero.
"
+Extra="The power mean is also known as the generalised mean and the Holder mean .
See Wikipedia for further information.
"
+Kind=routine
+Units=SysUtils,Math
+SeeAlso=ArithmeticMean_Double,GeometricMean_Double,HarmonicMean_Double,PowerMean_Cardinal,PowerMean_Integer,LogarithmicMean,WeightedPowerMean_Double,Mode,ModeAlt,Median_Double
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=691.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[PowerMean_Integer]
+DisplayName="PowerMean (Integer overload)"
+DescEx="Returns the power mean of the elements of Integer array Values , with exponent Lambda .
An EArgumentException is raised if the array is empty, if any array element is negative or if Lambda is zero.
"
+Extra="The power mean is also known as the generalised mean and the Holder mean .
See Wikipedia for further information.
"
+Kind=routine
+Units=Types
+Depends=PowerMean_Double
+SeeAlso=ArithmeticMean_Integer,GeometricMean_Integer,HarmonicMean_Integer,PowerMean_Double,PowerMean_Cardinal,LogarithmicMean,WeightedPowerMean_Integer,Median_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=692.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[PowerMean_Cardinal]
+DisplayName="PowerMean (Cardinal overload)"
+DescEx="Returns the power mean of the elements of Cardinal array Values , with exponent Lambda .
An EArgumentException is raised if the array is empty or if Lambda is zero.
"
+Extra="The power mean is also known as the generalised mean and the Holder mean .
See Wikipedia for further information.
"
+Kind=routine
+Units=Types
+Depends=PowerMean_Double
+SeeAlso=ArithmeticMean_Cardinal,GeometricMean_Cardinal,HarmonicMean_Cardinal,PowerMean_Double,PowerMean_Integer,LogarithmicMean,WeightedPowerMean_Cardinal
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=693.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[WeightedPowerMean_Double]
+DisplayName="WeightedPowerMean (Double overload)"
+DescEx="Returns the weighted power mean of the elements of Double array Values , with exponent Lambda . Each term is weighted by the corresponding element in the array Weights .
An EArgumentException exception is raised if any of the following pre-conditions are not met: Values must be non-empty; no element of Values may be negative; Values & Weights must have the same number of elements; all elements of Weights must be non-negative, with at least one element being non-zero; Lambda must not be zero.
"
+Extra="The power mean is also known as the generalised mean and the Holder mean .
See Statistics How To for further information.
"
+Kind=routine
+Units=SysUtils,Types,Math
+Depends=NormaliseByWeight_Double
+SeeAlso=WeightedArithmeticMean_Double,WeightedGeometricMean_Double,WeightedHarmonicMean_Double,PowerMean_Double,WeightedPowerMean_Cardinal,WeightedPowerMean_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=694.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[WeightedPowerMean_Integer]
+DisplayName="WeightedPowerMean (Integer overload)"
+DescEx="Returns the weighted power mean of the elements of Integer array Values , with exponent Lambda . Each term is weighted by the corresponding element in the array Weights .
An EArgumentException exception is raised if any of the following pre-conditions are not met: Values must be non-empty; no element of Values may be negative; Values & Weights must have the same number of elements; all elements of Weights must be non-negative, with at least one element being non-zero; Lambda must not be zero.
"
+Extra="The power mean is also known as the generalised mean and the Holder mean .
See Statistics How To for further information.
"
+Kind=routine
+Units=Types
+Depends=WeightedPowerMean_Double
+SeeAlso=WeightedArithmeticMean_Integer,WeightedGeometricMean_Integer,WeightedHarmonicMean_Integer,PowerMean_Integer,WeightedPowerMean_Cardinal,WeightedPowerMean_Double
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=695.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[WeightedPowerMean_Cardinal]
+DisplayName="WeightedPowerMean (Cardinal overload)"
+DescEx="Returns the weighted power mean of the elements of Cardinal array Values , with exponent Lambda . Each term is weighted by the corresponding element in the array Weights .
An EArgumentException exception is raised if any of the following pre-conditions are not met: Values must be non-empty; Values & Weights must have the same number of elements; all elements of Weights must be non-negative, with at least one element being non-zero; Lambda must not be zero.
"
+Extra="The power mean is also known as the generalised mean and the Holder mean .
See Statistics How To for further information.
"
+Kind=routine
+Units=Types
+Depends=WeightedPowerMean_Double
+SeeAlso=WeightedArithmeticMean_Cardinal,WeightedGeometricMean_Cardinal,WeightedHarmonicMean_Cardinal,PowerMean_Cardinal,WeightedPowerMean_Double,WeightedPowerMean_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=696.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[Mode]
+DisplayName="Mode"
+DescEx="Calculates the mode of array A of integer data. Returns an array containing the mode or modes of the data.
If the data has a single mode, then a single element array containing the mode is returned. If the data is multi-modal then all the modes are returned. If all data items occur with equal frequency then an array of all unique data items is returned. The returned data is sorted in ascending order.
Raises EArgumentException if A has fewer than two elements.
"
+Extra="Some sources state that if all numbers in A occur the same number of times, and not all data items are the same, then no mode is defined. It is not obvious how this situation should be handled.
This function takes the same approach as the CalculatorSoup online Mean, Median, Mode calculator. For example Mode([1,1,2,2,3,3]) returns [1,2,3] while Mode([2,2,2]) returns [2] .
Another solution is to return an empty array when there is no mode. This is the approach taken by ModeAlt .
See Wikipedia for more information about mode.
"
+Kind=routine
+Units=SysUtils,Generics.Collections
+Depends=CountOccurrences
+SeeAlso=Median_Double,ArithmeticMean_Double,GeometricMean_Double,HarmonicMean_Double,PowerMean_Double,LogarithmicMean,ModeAlt,ModeCount,HasMode
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=697.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[ModeAlt]
+DisplayName="ModeAlt"
+DescEx="Calculates the mode of array A of integer data. Returns an array containing the mode or modes of the data, if any.
If the data has a single mode, then a single element array containing the mode is returned. If the data is multi-modal then all the modes are returned, sorted in ascending order. If all data items occur with equal frequency, and not all data items are the same, then there is no mode and an empty array is returned.
Raises EArgumentException if A has fewer than two elements.
"
+Extra="Some sources state that if all numbers in A occur the same number of times, and not all data items are the same, then no mode is defined. It is not obvious how this situation should be handled.
This function returns an empty array when there is no mode. For example ModeAlt([1,1,2,2,3,3]) returns an empty array while ModeAlt([2,2,2]) returns [2] .
Another solution, adopted by CalculatorSoup is to return all the unique elements of A . The Mode function also takes this approach.
See Wikipedia for more information about mode.
"
+Kind=routine
+Units=SysUtils,Generics.Collections
+Depends=CountOccurrences
+SeeAlso=Median_Double,ArithmeticMean_Double,GeometricMean_Double,HarmonicMean_Double,PowerMean_Double,LogarithmicMean,Mode,ModeCount,HasNode
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=698.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[CountOccurrences]
+DisplayName="CountOccurrences"
+DescEx="Calculates the number of occurrences of each unique element of array A . An array of TPair<Integer,Cardinal> values is returned, where the Key field of each TPair element is the integer and the Value field is the number of times the integer occurs in A . The returned array is sorted on the Key field.
Raises EArgumentException if A is empty.
"
+Extra="Examples of use and output:
CountOccurrences([2,2,2]) returns [(Key:2;Value:3)] .
CountOccurrences([56,42,42,42,56,-66]) returns [(Key:-66;Value:1),(Key:42;Value:3),(Key:56;Value:2)] . Note how the returned array is sorted.
CountOccurrences([12]) returns [Key:12;Value:2] .
"
+Kind=routine
+Units=SysUtils,Generics.Defaults,Generics.Collections
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=699.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[ModeCount]
+DisplayName="ModeCount"
+DescEx="Returns the number of modes of integer array A .
Raises EArgumentException if A has fewer than two elements.
"
+Extra="A return value of zero indicates that the value of the array have no mode. This is considered to be when every integer occurs the same number of times and not all data items are the same.
Examples:
ModeCount([1,1,2,2,3,3]) returns 0 because 1, 2 and 3 all occur the same number of times. The mode is undefined.
ModeCount([2,2,2]) returns 1 because all the integers are the same (the mode is 2).
ModeCount([1,2,3,3,4,5]) returns 1 (the mode is 3).
ModeCount([1,2,2,3,3]) returns 2 (the modes are 2 & 3).
See Wikipedia for more information about mode.
"
+Kind=routine
+Units=SysUtils,Generics.Collections
+Depends=CountOccurrences
+SeeAlso=Mode,ModeAlt,HasMode
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=700.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[HasMode]
+DisplayName="HasMode"
+DescEx="Checks if the given array of integers A has a mode and returns True if so.
Raises EArgumentException if A has fewer than two elements.
"
+Extra="An array of integers is considered to have a mode unless every integer occurs the same number of times and not all data items are the same.
Examples:
HasNode([1,1,2,2,3,3]) returns False because 1, 2 and 3 all occur the same number of times.
HasNode([2,2,2]) returns True because all the integers are the same (the mode is 2).
HasNode([1,2,3,3,4,5]) returns True (the mode is 3).
HasNode([1,2,2,3,3]) returns True (the modes are 2 & 3).
See Wikipedia for more information about mode.
"
+Kind=routine
+Units=SysUtils,Generics.Collections
+Depends=CountOccurrences
+SeeAlso=Mode,ModeAlt,ModeCount
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=701.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[RMS_Double]
+DisplayName="RMS (Double overload)"
+DescEx="Calculates the root mean square of the elements of Double floating point array A .
Raises EArgumentException if A is empty.
"
+Kind=routine
+Units=SysUtils,Math
+Depends=ArithmeticMean_Double
+SeeAlso=RMS_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=702.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[RMS_Integer]
+DisplayName="RMS (Integer overload)"
+DescEx="Calculates the root mean square of the elements of Integer array A .
Raises EArgumentException if A is empty.
"
+Kind=routine
+Units=SysUtils,Math
+Depends=ArithmeticMean_Double
+SeeAlso=RMS_Double
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=703.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[TSS_Double]
+DisplayName="TSS (Double overload)"
+DescEx="Calculates the statistical total sum of squares of the elements of Double array A .
EArgumentException is raised if A is empty.
"
+Extra="See Wikipedia for an explanation of the TSS function.
Note: TSS is not the same as the SumOfSquares function in the Delphi RTL.
"
+Kind=routine
+Depends=ArithmeticMean_Double
+SeeAlso=TSS_Integer
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=704.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
+[TSS_Integer]
+DisplayName="TSS (Integer overload)"
+DescEx="Calculates the statistical total sum of squares of the elements of Integer array A .
EArgumentException is raised if A is empty.
"
+Extra="See Wikipedia for an explanation of the TSS function.
Note: TSS is not the same as the SumOfSquares function in the Delphi RTL.
"
+Kind=routine
+Depends=ArithmeticMean_Integer
+SeeAlso=TSS_Double
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Maths"
+Snip=705.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
diff --git a/csdb/collection/multimedia.ini b/collection/multimedia.ini
similarity index 85%
rename from csdb/collection/multimedia.ini
rename to collection/multimedia.ini
index 746a661..c012dda 100644
--- a/csdb/collection/multimedia.ini
+++ b/collection/multimedia.ini
@@ -2,7 +2,7 @@
#
# Multi Media category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[PlaySound]
@@ -26,4 +26,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
diff --git a/csdb/collection/registry.ini b/collection/registry.ini
similarity index 94%
rename from csdb/collection/registry.ini
rename to collection/registry.ini
index e6bb291..f0ec82b 100644
--- a/csdb/collection/registry.ini
+++ b/collection/registry.ini
@@ -2,12 +2,15 @@
#
# Registry category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[GetRegistryString]
DescEx="Reads and returns the value named by Name from the registry sub-key SubKey in root key RootKey .
String, expanded string and integer value types are all handled, with integer values being converted to strings. Other values types are not supported and cause an exception to be raised.
The empty string is returned if the named value does not exist.
"
Units=Windows,SysUtils,Registry
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-WinSys"
Snip=067.dat
Delphi2=N
Delphi3=N
@@ -25,6 +28,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RegKeyList]
@@ -49,6 +54,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RegValueList]
@@ -73,6 +80,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RegDeleteValue]
@@ -98,6 +107,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RegParsePath]
@@ -121,6 +132,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RegReadString]
@@ -146,6 +159,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RegValueExists]
@@ -171,6 +186,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RegWriteString]
@@ -196,4 +213,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
diff --git a/csdb/collection/shell.ini b/collection/shell.ini
similarity index 95%
rename from csdb/collection/shell.ini
rename to collection/shell.ini
index b81effc..2d63968 100644
--- a/csdb/collection/shell.ini
+++ b/collection/shell.ini
@@ -2,7 +2,7 @@
#
# Windows Shell category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[AddToRecentDocs]
@@ -26,6 +26,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[ClearRecentDocs]
@@ -49,6 +51,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[CreateShellLink]
@@ -73,6 +77,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ExecAndWait]
@@ -96,6 +102,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ExecAssociatedApp]
@@ -119,6 +127,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ExploreFile]
@@ -143,6 +153,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ExploreFolder]
@@ -166,6 +178,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[FileFromShellLink]
@@ -190,6 +204,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[FindAssociatedApp]
@@ -213,6 +229,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[FreePIDL]
@@ -235,6 +253,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[GetDesktopFolder]
@@ -260,6 +280,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[GetFileType]
@@ -284,6 +306,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetGenericFileType]
@@ -308,6 +332,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetKnownFolderPath]
@@ -332,6 +358,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[IsShellLink]
@@ -356,6 +384,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[LoadShellLink]
@@ -380,6 +410,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[OpenFolder]
@@ -403,6 +435,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[PIDLToFolderPath]
@@ -426,6 +460,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[ShowFindFilesDlg]
@@ -450,6 +486,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ShowShellPropertiesDlg]
@@ -474,6 +512,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[TaskbarBounds]
@@ -498,6 +538,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[TaskbarHandle]
@@ -522,6 +564,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TrayHandle]
@@ -546,6 +590,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[EmptyRecycleBin]
@@ -570,6 +616,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsIEInstalled]
@@ -593,6 +641,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsSpecialFolderSupported]
@@ -618,6 +668,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[RecycleBinInfo]
@@ -642,6 +694,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SpecialFolderPath]
@@ -667,6 +721,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[SysImageListHandle]
@@ -690,6 +746,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SysImageListHandleEx]
@@ -714,6 +772,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[TaskAllocWideString]
@@ -737,4 +797,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
diff --git a/csdb/collection/string.ini b/collection/string.ini
similarity index 93%
rename from csdb/collection/string.ini
rename to collection/string.ini
index 44de637..eb8f718 100644
--- a/csdb/collection/string.ini
+++ b/collection/string.ini
@@ -2,7 +2,7 @@
#
# String Management category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[AddThousandSeparator]
@@ -26,6 +26,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ContainsDelims]
@@ -49,6 +51,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[CountDelims]
@@ -72,6 +76,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[CountUnquotedWords]
@@ -96,6 +102,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DelAllStr]
@@ -120,6 +128,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DelAllText]
@@ -144,6 +154,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DelStr]
@@ -168,6 +180,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DelText]
@@ -192,6 +206,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DOSLineBreaks]
@@ -216,6 +232,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ExplodeUnquotedWords]
@@ -240,6 +258,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsValidDouble]
@@ -263,6 +283,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsValidExtended]
@@ -286,6 +308,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsValidSingle]
@@ -309,6 +333,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[JoinStr]
@@ -332,6 +358,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[JoinStrArray]
@@ -354,6 +382,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[LastChar]
@@ -377,6 +407,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[LastPos]
@@ -399,6 +431,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[MultiSzToStrings]
@@ -422,6 +456,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[AddDefThousandSeparator]
@@ -451,6 +487,13 @@ DelphiXE6=N
DelphiXE7=N
DelphiXE8=N
Delphi10S=N
+Delphi101B=N
+Delphi102T=N
+Delphi103R=N
+Delphi104S=N
+Delphi11A=N
+Delphi12A=N
+Delphi13F=N
FPC=Y
[AddDefThousandSeparatorXE]
@@ -476,6 +519,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[AnsiStringToCharSet]
@@ -499,6 +544,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[CEscapeStr]
@@ -523,6 +570,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ChangeChar]
@@ -545,6 +594,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[CompareNumberStr]
@@ -564,6 +615,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[CompressWhiteSpace]
@@ -589,6 +642,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ContainsWhiteSpace]
@@ -613,6 +668,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[CountWords]
@@ -638,6 +695,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[CUnEscapeStr]
@@ -662,6 +721,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[CutWordByIndex]
@@ -686,6 +747,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DeleteWordByIndex]
@@ -709,6 +772,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ExplodeStr]
@@ -734,6 +799,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ExplodeStrArray]
@@ -759,6 +826,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ExplodeWords]
@@ -784,6 +853,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetFirstWord]
@@ -809,6 +880,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetLastWord]
@@ -834,6 +907,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetStartAndEndWord]
@@ -858,6 +933,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetWordByIndex]
@@ -881,6 +958,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[InString]
@@ -899,6 +978,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsHexStr]
@@ -922,6 +1003,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsNumeric]
@@ -929,6 +1012,8 @@ Units=SysUtils
DescEx="Checks if the string Value contains a valid numeric value and returns True if so or False if not.
If AllowFloat is true then Value may contain a floating point number, otherwise it must be an integer. If TrimWhiteSpace is True any white space surrounding Value is trimmed before testing.
"
Extra="Floating point numbers can be in normal or scientific notation.
Integers can be expressed as decimal or hexadecimal numbers, with hex numbers prefixed by either '$' or '0x' .
"
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-String"
Snip=132.dat
Delphi2=N
Delphi3=N
@@ -946,6 +1031,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsValidCEscapedStr]
@@ -970,6 +1057,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsWhiteSpace]
@@ -995,6 +1084,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[PadCenter]
@@ -1018,6 +1109,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[PadLeft]
@@ -1041,6 +1134,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[PadRight]
@@ -1064,6 +1159,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ParseDelims]
@@ -1086,6 +1183,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ReverseStr]
@@ -1094,6 +1193,8 @@ Extra="Renamed from a routine contributed by Rubem Nascimento da Rocha.
"
Units=SysUtils,StrUtils
SeeAlso=ReverseStrR
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-String"
Snip=438.dat
Delphi2=N
Delphi3=N
@@ -1111,6 +1212,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ReverseStrR]
@@ -1119,6 +1222,8 @@ Extra="Uses recursion.
Renamed from a routine contributed by Rubem Nasc
Units=SysUtils,StrUtils
SeeAlso=ReverseStr
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-String"
Snip=439.dat
Delphi2=N
Delphi3=N
@@ -1136,6 +1241,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SplitStr]
@@ -1159,6 +1266,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[StripAccelChars]
@@ -1166,6 +1275,8 @@ DescEx="
Strips all accelerator ('& ') characters from the giv
Extra="
Renamed from a routine contributed by Rubem Nascimento da Rocha.
"
Units=SysUtils
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-String"
Snip=440.dat
Delphi2=N
Delphi3=N
@@ -1183,6 +1294,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[StripLastChar]
@@ -1206,6 +1319,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[StrToken]
@@ -1230,6 +1345,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[StrTokenCount]
@@ -1254,6 +1371,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TextWrap]
@@ -1277,6 +1396,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TrimChar]
@@ -1301,6 +1422,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TrimLeftChar]
@@ -1324,6 +1447,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TrimRightChar]
@@ -1347,6 +1472,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TrimStringList]
@@ -1371,6 +1498,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[UnixLineBreaks]
@@ -1395,6 +1524,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ParseStr]
@@ -1403,6 +1534,8 @@ Extra="If StrToParse contains adjacent Delimiter charac
Units=Classes
SeeAlso=ExplodeStr,ParseDelims,SplitStr,SplitString
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-String"
Snip=626.dat
Delphi7=Y
Delphi2005Win32=Y
@@ -1415,6 +1548,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[PosByIndex]
@@ -1439,6 +1574,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[QuoteSpacedString]
@@ -1462,6 +1599,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ReduceStr]
@@ -1484,6 +1623,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ReplaceWordByIndex]
@@ -1508,6 +1649,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RemoveDuplicateStrings]
@@ -1527,6 +1670,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SplitPathList_A]
@@ -1553,6 +1698,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SplitPathList_B]
@@ -1579,6 +1726,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SplitString]
@@ -1587,6 +1736,8 @@ Extra="
If AText contains adjacent Delimiter strings wit
Units=SysUtils,Classes
SeeAlso=ExplodeStr,ParseDelims,ParseStr,SplitStr
TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-String"
Snip=627.dat
Delphi7=Y
Delphi2005Win32=Y
@@ -1599,6 +1750,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[StringsToMultiSz]
@@ -1623,6 +1776,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[StripDuplicateStrings]
@@ -1642,6 +1797,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[StripWhiteSpace]
@@ -1667,6 +1824,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TitleCase]
@@ -1691,6 +1850,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[WordCount]
@@ -1716,4 +1877,18 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
+
+[RandomString]
+DescEx="
Returns a random string from the given non-empty string list.
An EArgumentException exception is raised if the string list is empty.
"
+Extra="The Delphi RTL has a similar RandomFrom function in StrUtils that returns a random string from a string array.
"
+Units=SysUtils,Classes
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-String"
+Snip=707.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
diff --git a/csdb/collection/structs.ini b/collection/structs.ini
similarity index 51%
rename from csdb/collection/structs.ini
rename to collection/structs.ini
index 444ab30..8ed2c25 100644
--- a/csdb/collection/structs.ini
+++ b/collection/structs.ini
@@ -2,13 +2,16 @@
#
# Structures category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[BoundsF]
DescEx="Constructs and returns a TRectF record with the given top-left coordinate, width and height.
"
SeeAlso=RectF,TRectF
Depends=TRectF
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Structs"
Snip=493.dat
Delphi2=Y
Delphi3=Y
@@ -26,10 +29,15 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[PointF]
DescEx="Constructs and returns a TPointF record with the given x & y coordinates.
"
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Structs"
SeeAlso=TPointF,RectF
Depends=TPointF
Snip=491.dat
@@ -49,13 +57,18 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[Range]
-DescEx="Constructs and returns a TRange record with bounds A and B .
The smaller of A and B is used as the lower bound and the larger as the upper bound. If both values are equal then the range will be empty.
"
+DescEx="Constructs and returns a TRange record with bounds A and B .
The smaller of A and B is used as the lower bound and the other parameter is used as the upper bound.
"
Depends=TRange
SeeAlso=TRange
-SeeAlso=TRange,TRangeEx
+SeeAlso=TRange,TRangeEx,TIntegerRange
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Structs"
Snip=580.dat
Delphi7=Y
Delphi2005Win32=Y
@@ -68,12 +81,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RectF]
DescEx="Constructs and returns a TRectF record with the given left, top, right & bottom coordinates.
"
SeeAlso=BoundsF,PointF,TRectF
Depends=TRectF
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Structs"
Snip=492.dat
Delphi2=Y
Delphi3=Y
@@ -91,6 +109,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[Size]
@@ -98,6 +118,9 @@ DescEx="Constructs and returns a TSize record with the given dimen
Extra="
This routine complements the Rect and Point routines defined in the Delphi RTL.
For versions of Delphi before Delphi 6 replace the Types unit with Windows to get the routine to compile.
"
Units=Types
SeeAlso=TSizeEx
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Structs"
Snip=488.dat
Delphi2=N
Delphi3=N
@@ -115,12 +138,32 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
+[TIntegerRange]
+DisplayName=TIntegerRange
+DescEx="An advanced record that encapsulates an integer range along with operations on it.
The range is immutable, so the constructor must be used to instantiate a non-empty range.
"
+Extra="TIntegerRange supports various operator overloads, which operate in a way similar to the Pascal set operators:
= compares two ranges for equality.
<> compares two ranges for inequality.
<= checks if the left operand is wholly contained in, or is equal to the right operand (c.f. Pascal subset operator).
>= checks if the left operand wholly contains, or is equal to, the right hand operand (c.f. Pascal proper superset operator).
+ creates the union of the two ranges specified by the operands, i.e. a new range that is the smallest range that contains both operands. For example, representing a range as [A..B] , [1..3] + [7..10] = [1..10] (c.f. Pascal union operator).
* creates a new range that the largest range contained in both ranges specified by the operands, or an empty range if the operands do not overlap. For example, [1..3] * [2..7] = [2..3] while [1..3] * [6..9] is an empty range. (c.f. Pascal intersection operator).
in checks if the integer specified in the left hand operand is contained in the range specified by the right hand operand (c.f. Pascal membership operator).
"
+Kind=class
+Units=SysUtils,Math
+SeeAlso=TRange,TRangeEx
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Structs"
+Snip=706.dat
+DelphiXE=Y
+Delphi12A=Y
+Delphi13F=Y
+
[TPointF]
Kind=type
DescEx="Encapsulates a point with double precision floating point coordinates.
"
SeeAlso=PointF,TRectF
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Structs"
Snip=489.dat
Delphi2=Y
Delphi3=Y
@@ -138,13 +181,18 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TRange]
Kind=type
DescEx="Encapsulates the upper and lower bounds of a range of values.
"
SeeAlso=Range
-SeeAlso=Range,TRangeEx
+SeeAlso=Range,TRangeEx,TIntegerRange
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Structs"
Snip=579.dat
Delphi7=Y
Delphi2005Win32=Y
@@ -157,6 +205,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TRectF]
@@ -164,6 +214,9 @@ Kind=type
DescEx="Encapsulates a rectangle with double precision floating point size and position.
"
SeeAlso=RectF,BoundsF,TPointF
Depends=TPointF
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Structs"
Snip=490.dat
Delphi2=Y
Delphi3=Y
@@ -181,13 +234,19 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TRangeEx]
Kind=class
DescEx="Encapsulates a range of integers with a methods to test whether a value falls within the range and to adjust the value to fit.
"
+Extra="Warning: It is up to the caller to ensure that the Min field is always less than or equal to the Max field otherwise the Constrain method will return crazy values and Contains will always return False .
"
Units=Math
-SeeAlso=Range,TRange
+SeeAlso=Range,TRange,TIntegerRange
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Structs"
Snip=578.dat
Delphi2=N
Delphi3=N
@@ -205,6 +264,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TSizeEx]
@@ -212,6 +273,9 @@ Kind=class
DescEx="Record that represents the size, i.e. the width and height, of something.
This is an extended version of the TSize record that features equality and inequality operator overloading, a test for zero size and a constructor.
TSizeEx is assignment compatible and comparible with the Delphi RTL's TSize record.
"
Units=Types
SeeAlso=Size
+TestInfo=advanced
+AdvancedTest.Level=unit-tests
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Structs"
Snip=510.dat
Delphi2=N
Delphi3=N
@@ -229,4 +293,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
diff --git a/csdb/collection/sys.ini b/collection/sys.ini
similarity index 95%
rename from csdb/collection/sys.ini
rename to collection/sys.ini
index 89c4243..0f5bd8c 100644
--- a/csdb/collection/sys.ini
+++ b/collection/sys.ini
@@ -2,7 +2,7 @@
#
# System category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[DebuggerPresent]
@@ -26,6 +26,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[Delay]
@@ -50,6 +52,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[EmptyKeyQueue]
@@ -74,6 +78,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetBiosVendor]
@@ -98,6 +104,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetCharFromVirtualKey]
@@ -121,6 +129,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetParentProcessID]
@@ -144,6 +154,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[GetProcessName]
@@ -167,6 +179,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[GetProcessorIdentifier]
@@ -191,6 +205,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetProcessorName]
@@ -215,6 +231,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetSystemManufacturer]
@@ -239,6 +257,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetSystemProductName]
@@ -263,6 +283,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetWindowProcessID]
@@ -286,6 +308,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetWindowProcessName]
@@ -310,6 +334,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[GetWindowThreadID]
@@ -333,6 +359,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[HostIPAddress]
@@ -356,6 +384,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsAdmin]
@@ -379,6 +409,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsKeyPressed]
@@ -402,6 +434,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsLockKeyOn]
@@ -425,6 +459,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsRunningOnBattery]
@@ -449,6 +485,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[Pause]
@@ -474,6 +512,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ProgramFileName]
@@ -498,6 +538,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ProgramFileSpec]
@@ -521,6 +563,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ProgramName]
@@ -544,6 +588,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ProgramPath]
@@ -569,6 +615,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RemainingBatteryPercent]
@@ -593,6 +641,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SendKeysToWindow]
@@ -617,6 +667,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SetLockKeyState]
@@ -641,6 +693,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[CurrentMemoryUsage]
@@ -665,6 +719,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[DeleteEnvVar]
@@ -684,6 +740,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DOSCommand]
@@ -704,6 +762,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DOSCommandRedirect_A]
@@ -724,6 +784,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DOSCommandRedirect_B]
@@ -744,6 +806,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetAllEnvVars]
@@ -764,6 +828,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetAvailablePhysMemory]
@@ -783,6 +849,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[GetDefaultPrinterName]
@@ -805,6 +873,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[GetEnvironmentBlockSize]
@@ -824,6 +894,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetEnvVar]
@@ -842,6 +914,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetErrorMessageWithId]
@@ -861,6 +935,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetMacAddress]
@@ -884,6 +960,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[GetPercentMemoryUsed]
@@ -903,6 +981,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[GetTotalPhysMemory]
@@ -922,6 +1002,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[IsAppResponding]
@@ -946,6 +1028,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[IsLibraryInstalled]
@@ -969,6 +1053,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[PostKeyEx32]
@@ -993,6 +1079,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ProcessMessages]
@@ -1016,6 +1104,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RefreshEnvironment]
@@ -1040,6 +1130,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SetEnvVar]
@@ -1059,6 +1151,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SetEnvVarValue]
@@ -1079,6 +1173,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SysUserErrorMessage]
@@ -1098,6 +1194,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TerminateProcessByID]
@@ -1116,6 +1214,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TrimAppMemorySize]
@@ -1140,4 +1240,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
diff --git a/csdb/collection/types.ini b/collection/types.ini
similarity index 93%
rename from csdb/collection/types.ini
rename to collection/types.ini
index 2fceea4..d385351 100644
--- a/csdb/collection/types.ini
+++ b/collection/types.ini
@@ -2,7 +2,7 @@
#
# Types category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[RawByteString]
@@ -26,6 +26,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TBytes]
@@ -50,6 +52,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TCharSet]
@@ -74,4 +78,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
diff --git a/csdb/collection/utils.ini b/collection/utils.ini
similarity index 94%
rename from csdb/collection/utils.ini
rename to collection/utils.ini
index 43fe8c4..9e8f24e 100644
--- a/csdb/collection/utils.ini
+++ b/collection/utils.ini
@@ -2,7 +2,7 @@
#
# Utilities category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[BytesToGB]
@@ -25,6 +25,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[BytesToGBStr]
@@ -48,6 +50,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[BytesToKB]
@@ -70,6 +74,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[BytesToKBStr]
@@ -93,6 +99,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[BytesToMB]
@@ -115,6 +123,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[BytesToMBStr]
@@ -138,6 +148,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[Clamp]
@@ -159,6 +171,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[CompilerVer]
@@ -181,6 +195,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[EndianSwap]
@@ -203,6 +219,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ExchangeInt]
@@ -224,6 +242,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[FloatToFixed]
@@ -247,6 +267,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[Int64ToFixed]
@@ -270,6 +292,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IntToFixed]
@@ -293,6 +317,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IntToNumberText]
@@ -317,6 +343,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IntToOctal]
@@ -339,6 +367,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IntToRoman]
@@ -362,6 +392,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsSubClassOf]
@@ -384,6 +416,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[Percentage]
@@ -407,6 +441,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[PercentageStr]
@@ -432,6 +468,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ReadBigEndianWord]
@@ -454,6 +492,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TryStrToByte]
@@ -478,6 +518,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TryStrToLongWord]
@@ -501,6 +543,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TryStrToWord]
@@ -524,6 +568,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[CheckBDEInstalled]
@@ -547,6 +593,13 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=N
+Delphi101B=N
+Delphi102T=N
+Delphi103R=N
+Delphi104S=N
+Delphi11A=N
+Delphi12A=N
+Delphi13F=N
FPC=N
[EnglishColorName]
@@ -570,6 +623,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[Exchange_Byte]
@@ -593,6 +648,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[Exchange_Int64]
@@ -616,6 +673,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[Exchange_Longint]
@@ -639,6 +698,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[Exchange_Longword]
@@ -662,6 +723,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[Exchange_Shortint]
@@ -685,6 +748,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[Exchange_Smallint]
@@ -708,6 +773,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[Exchange_UInt64]
@@ -731,6 +798,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[Exchange_Word]
@@ -754,6 +823,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[FloatToNumberText]
@@ -783,6 +854,13 @@ DelphiXE6=N
DelphiXE7=N
DelphiXE8=N
Delphi10S=N
+Delphi101B=N
+Delphi102T=N
+Delphi103R=N
+Delphi104S=N
+Delphi11A=N
+Delphi12A=N
+Delphi13F=N
FPC=Y
[FloatToNumberTextXE]
@@ -808,6 +886,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[FormInstanceCount_A]
@@ -833,6 +913,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[FormInstanceCount_B]
@@ -858,6 +940,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[FractionToStr]
@@ -882,6 +966,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[FractionToStrEx]
@@ -907,6 +993,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[FreeStringsObjects]
@@ -930,6 +1018,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IntToBinary_Int32]
@@ -949,6 +1039,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IntToBinary_Int64]
@@ -969,6 +1061,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsCharInSet]
@@ -993,6 +1087,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsFlagSet]
@@ -1015,6 +1111,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ProgIDInstalled]
@@ -1038,6 +1136,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[VariantIsObject]
@@ -1056,4 +1156,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
diff --git a/csdb/collection/wb.ini b/collection/wb.ini
similarity index 96%
rename from csdb/collection/wb.ini
rename to collection/wb.ini
index bce5aad..e6afe3a 100644
--- a/csdb/collection/wb.ini
+++ b/collection/wb.ini
@@ -2,7 +2,7 @@
#
# TWebBrowser category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[WBAppendHTML]
@@ -21,6 +21,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBBlankDocument]
@@ -41,6 +43,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBClearSelection]
@@ -60,6 +64,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBCopy]
@@ -80,6 +86,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBCut]
@@ -100,6 +108,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBDelete]
@@ -119,6 +129,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBGetOpticalZoomRange]
@@ -139,6 +151,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBInvokeCmd_A]
@@ -159,6 +173,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBInvokeCmd_B]
@@ -180,6 +196,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBIsDOMLoaded]
@@ -199,6 +217,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBNavigate_A]
@@ -220,6 +240,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBNavigate_B]
@@ -241,6 +263,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBPaste]
@@ -261,6 +285,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBRedo]
@@ -281,6 +307,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBSelectAll]
@@ -301,6 +329,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBSetOpticalZoom]
@@ -321,6 +351,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBShowFindDlg]
@@ -341,6 +373,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBShowPageSetupDlg]
@@ -361,6 +395,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBShowPrintDlg]
@@ -381,6 +417,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBShowPrintPreviewDlg]
@@ -401,6 +439,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBShowPropertiesDlg]
@@ -421,6 +461,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBShowSourceCode]
@@ -441,6 +483,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBUndo]
@@ -461,6 +505,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBWaitForDocToLoad]
@@ -481,6 +527,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WBWaitForDOMToLoad]
@@ -501,4 +549,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
diff --git a/csdb/collection/web.ini b/collection/web.ini
similarity index 96%
rename from csdb/collection/web.ini
rename to collection/web.ini
index 2f648a4..28a2c2b 100644
--- a/csdb/collection/web.ini
+++ b/collection/web.ini
@@ -2,7 +2,7 @@
#
# Internet category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[BrowseURL]
@@ -27,6 +27,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ColorToHTML]
@@ -49,6 +51,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[DownloadURLToFile]
@@ -73,6 +77,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetIEVersionStr]
@@ -95,6 +101,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsValidURLProtocol]
@@ -118,6 +126,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[CheckInternetConnection]
@@ -141,6 +151,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ExtractURIFragment]
@@ -165,6 +177,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ExtractURIQueryString]
@@ -189,6 +203,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsInternetConnected]
@@ -213,6 +229,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[MakeSafeHTMLText]
@@ -237,6 +255,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RemoveURIFragment]
@@ -261,6 +281,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[RemoveURIQueryString]
@@ -285,6 +307,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[URIDecode]
@@ -309,6 +333,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[URIEncode]
@@ -333,6 +359,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[URLDecode]
@@ -357,6 +385,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[URLEncode]
@@ -381,4 +411,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
diff --git a/csdb/collection/windows.ini b/collection/windows.ini
similarity index 94%
rename from csdb/collection/windows.ini
rename to collection/windows.ini
index fffbbc9..fa04148 100644
--- a/csdb/collection/windows.ini
+++ b/collection/windows.ini
@@ -2,7 +2,7 @@
#
# Windows category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[ClientRectToScreen]
@@ -26,6 +26,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[CtrlBoundsToScreen]
@@ -50,6 +52,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[DisableLayersSupport]
@@ -73,6 +77,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[DisableTreeViewToolTips]
@@ -96,6 +102,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[EnableLayersSupport]
@@ -120,6 +128,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetIdleTime]
@@ -143,6 +153,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[GetTopLevelWindow]
@@ -167,6 +179,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetWindowTitle]
@@ -190,6 +204,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[HScrollbarHeight]
@@ -214,6 +230,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[IsEqualResID]
@@ -238,6 +256,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsTopLevelWindow]
@@ -261,6 +281,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[MemoCursorPos]
@@ -284,6 +306,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[ResourceExists]
@@ -308,6 +332,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ResourceExistsEx]
@@ -331,6 +357,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ResourceIDToStr]
@@ -355,6 +383,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SetTransparencyLevel]
@@ -380,6 +410,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TreeNodeChildCount]
@@ -403,6 +435,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[VScrollbarWidth]
@@ -427,6 +461,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WinControlScrollbars]
@@ -451,6 +487,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WindowScrollbars]
@@ -475,6 +513,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[WindowSupportsLayers]
@@ -499,6 +539,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ContainsFocus]
@@ -524,6 +566,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[FocusedControl]
@@ -547,6 +591,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[IsIntResource]
@@ -571,6 +617,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[LangIDFromLCID]
@@ -595,6 +643,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[MakeLangID]
@@ -618,6 +668,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[MakeLCID]
@@ -642,6 +694,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[PrimaryLangID]
@@ -665,6 +719,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[REWordAtPos]
@@ -689,6 +745,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=N
[SortIDFromLCID]
@@ -713,6 +771,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SubLangID]
@@ -736,4 +796,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
diff --git a/csdb/collection/winsys.ini b/collection/winsys.ini
similarity index 72%
rename from csdb/collection/winsys.ini
rename to collection/winsys.ini
index 9b7fc04..48d685e 100644
--- a/csdb/collection/winsys.ini
+++ b/collection/winsys.ini
@@ -2,13 +2,16 @@
#
# Windows System category file
#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
+# This file is licensed under the MIT license, copyright © 2025 Peter Johnson,
# https://gravatar.com/delphidabbler
[CommonFilesFolder]
DescEx="Returns the Windows common files directory.
"
Depends=GetCurrentVersionRegStr
SeeAlso=ProgramFilesFolder,SystemFolder,TempFolder,WindowsFolder,GetDesktopFolder
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-WinSys"
Snip=040.dat
Delphi2=N
Delphi3=N
@@ -26,12 +29,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ComputerName]
DescEx="Returns the name of the host computer.
"
Units=Windows
SeeAlso=UserName
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-WinSys"
Snip=129.dat
Delphi2=Y
Delphi3=Y
@@ -49,12 +57,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[GetCurrentVersionRegStr]
DescEx="Returns the string value named by ValName from the Windows "CurrentVersion" registry key.
"
Units=Windows
Depends=GetRegistryString
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-WinSys"
Snip=038.dat
Delphi2=N
Delphi3=N
@@ -72,12 +85,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsMediaCenterOS]
DescEx="Checks if the host operating system includes Windows Media Center.
"
Units=Windows
SeeAlso=IsTabletOS,IsWinNT,IsWin9x,IsWow64,IsVista,IsWindows7
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-WinSys"
Snip=092.dat
Delphi2=Y
Delphi3=Y
@@ -95,12 +113,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsTabletOS]
DescEx="Checks if the host operating system is a Windows Tablet edition.
"
Units=Windows
SeeAlso=IsMediaCenterOS,IsWinNT,IsWin9x,IsWow64,IsVista,IsWindows7
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-WinSys"
Snip=093.dat
Delphi2=Y
Delphi3=Y
@@ -118,6 +141,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsVista]
@@ -125,6 +150,9 @@ DescEx="Checks if the host operating system is Windows Vista or later.
"
Extra="Works correctly even if the application has defined a Windows XP (or other) compatibility mode.
Contributed by Laurent Pierre.
"
Units=Windows
SeeAlso=IsWin9x,IsWinNT,IsWow64,IsTabletOS,IsMediaCenterOS,IsWindows7
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-WinSys"
Snip=151.dat
Delphi2=Y
Delphi3=Y
@@ -142,12 +170,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsWin9x]
DescEx="Checks if the host operating system is on the Windows 9x platform.
"
Units=SysUtils,Windows
SeeAlso=IsWinNT,IsWow64,IsVista,IsWindows7,IsTabletOS,IsMediaCenterOS
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-WinSys"
Snip=091.dat
Delphi2=Y
Delphi3=Y
@@ -165,6 +198,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsWindows7]
@@ -172,6 +207,9 @@ DescEx="Checks if the host operating system is Windows 7 (or Windows Server 2
Extra="
Works correctly even if the application has defined a Windows Vista (or other) compatibility mode.
"
Units=Windows
SeeAlso=IsWin9x,IsWinNT,IsWow64,IsTabletOS,IsMediaCenterOS,IsVista
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-WinSys"
Snip=292.dat
Delphi2=Y
Delphi3=Y
@@ -189,12 +227,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsWinNT]
DescEx="Checks if the host operating system is on the Windows NT platform.
"
Units=SysUtils,Windows
SeeAlso=IsVista,IsWindows7,IsWin9x,IsWow64,IsTabletOS,IsMediaCenterOS
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-WinSys"
Snip=065.dat
Delphi2=Y
Delphi3=Y
@@ -212,12 +255,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsWow64]
DescEx="Checks if the current process is executing as a 32 bit process under WOW64 on 64 bit Windows.
"
Units=SysUtils,Windows
SeeAlso=IsWin9x,IsWinNT,IsVista,IsWindows7,IsTabletOS,IsMediaCenterOS
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-WinSys"
Snip=085.dat
Delphi2=Y
Delphi3=Y
@@ -235,12 +283,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ProgramFilesFolder]
DescEx="Returns the Windows program files directory.
"
Depends=GetCurrentVersionRegStr
SeeAlso=CommonFilesFolder,SystemFolder,TempFolder,WindowsFolder,GetDesktopFolder
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-WinSys"
Snip=039.dat
Delphi2=N
Delphi3=N
@@ -258,6 +311,8 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[ScreenResolution]
@@ -280,12 +335,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[SystemFolder]
DescEx="Returns the Windows system directory.
"
Units=Windows
SeeAlso=CommonFilesFolder,ProgramFilesFolder,TempFolder,WindowsFolder,GetDesktopFolder
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-WinSys"
Snip=042.dat
Delphi2=Y
Delphi3=Y
@@ -303,12 +363,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[TempFolder]
DescEx="Returns the Windows temporary directory.
"
Units=Windows
SeeAlso=CommonFilesFolder,ProgramFilesFolder,SystemFolder,TempFileName,WindowsFolder,TempFolder
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-WinSys"
Snip=043.dat
Delphi2=Y
Delphi3=Y
@@ -326,12 +391,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[UserName]
DescEx="Returns the name of the current user.
"
Units=Windows
SeeAlso=ComputerName
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-WinSys"
Snip=130.dat
Delphi2=Y
Delphi3=Y
@@ -349,12 +419,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[WindowsFolder]
DescEx="Returns the Windows directory.
"
Units=Windows
SeeAlso=CommonFilesFolder,ProgramFilesFolder,SystemFolder,TempFolder,WindowsFolder
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-WinSys"
Snip=041.dat
Delphi2=Y
Delphi3=Y
@@ -372,12 +447,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[WindowsProductID]
DescEx="Returns the Windows product ID.
"
Units=Windows
Depends=GetRegistryString,IsWinNT
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-WinSys"
Snip=071.dat
Delphi2=N
Delphi3=N
@@ -395,12 +475,17 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
[IsRemoteSession]
DescEx="Checks if the program is running under Windows Terminal Server in a remote client session.
"
Extra="Note: This function requires Windows NT4 SP4 or later. It does not work on the Windows 9x platform.
"
Units=Windows
+TestInfo=advanced
+AdvancedTest.Level=demo
+AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-WinSys"
Snip=302.dat
Delphi2=Y
Delphi3=Y
@@ -418,4 +503,6 @@ DelphiXE2=Y
DelphiXE3=Y
DelphiXE4=Y
Delphi10S=Y
+Delphi12A=Y
+Delphi13F=Y
FPC=Y
diff --git a/csdb/CHANGELOG.md b/csdb/CHANGELOG.md
deleted file mode 100644
index e27edee..0000000
--- a/csdb/CHANGELOG.md
+++ /dev/null
@@ -1,66 +0,0 @@
-# Changelog
-
-This is the change log for the _DelphiDabbler Code Snippets Database_ collection.
-
-From v2.0.0 all notable changes to this project will be documented in this file.
-
-> No change log was kept for version 1 of the collection.
-
-The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-
-## v2.1.1 of 2021/12/29 (HOTFIX)
-
-* Fixed malformed REML tags. Fixes [issue #7](https://github.com/delphidabbler/code-snippets/issues/7).
-
-## v2.1.0 of 2021/12/26
-
-* Deprecated `Desc`, `Comments`, `Credits` & `Credits_URL` keys in Code Snippets Database collection and changed `DescEx` key to be required. Made following changes to `.ini` files as a consequence:
- * Changed all `Desc` keys to `DescEx` keys and removed all `Desc` keys as a result.
- * Converted content of all `Comments`, `Credits` & `Credits_URL` keys to `Extra` key values and removed the deprecated keys.
-* Made all `DescEx` and `Extra` values fully REML v4 compliant by ensuring all content is wrapped in ``..`
` tags.
-* Fixed errors in `.ini` files. Fixes [issue #6](https://github.com/delphidabbler/code-snippets/issues/6).
-* Updated a small number of snippet descriptions and extra information.
-* Updated documentation in `collection-format.html` and `reml.html` to reflect the above changes.
-
-## v2.0.1 of 2021/10/12
-
-* Add new unit tests and demo code for _some_ snippets from the database. All such code was added to a new `tests` directory. See `tests/README.md` for details.
-* Fix minor errors in documentation.
-
-> Other than to update the `VERSION` file there were no changes to any snippets or associated meta-data in this release.
-
-## v2.0.0 of 2020/05/02
-
-Initial release of v2 of the collection.
-
-### Changes since last v1 release
-
-* Removed any code that restricted use of the collection to _[DelphiDabbler CodeSnip](https://github.com/delphidabbler/codesnip)_. The collection can now be used by 3rd party applications.
- * Removed backwards compatibility with _CodeSnip_ v4.15.1 and earlier.
- * Removed conditionally included code and _CodeSnip_ version dependent code from category .ini files.
- * Merged multiple versions of category .ini files down into a single file. (These multiple file were used to hide some categories from earlier versions of _CodeSnip_).
- * Removed duplicated, _CodeSnip_ version dependent, source code files: used a copy of the most recent version and removed version specifiers from the file names.
-* Rationalised and corrected errors in category .ini files:
- * Condensed two string management categories into one.
- * Removed `Desc` keys where they duplicated `DescEx` keys.
- * Removed some duplicate `Credits` and `Comments` keys.
- * Removed some empty keys.
- * Fixed or removed some broken web links.
- * Rephrased some descriptive text.
-* Changed layout of category .ini files and `categories.ini`:
- * Re-ordered sections of `categories.ini` in alphabetic order.
- * Removed all explanatory comments: there were inconsistencies.
- * Added header comments, including copyright and licensing information, to all .ini files.
-* File format changes:
- * Removed the `StandardFormat` key from the specification of category .ini files.
- * Added requirements for `LICENSE`, `LICENSE_INFO` and `VERSION` files and added suitable files to the collection.
- * Changed the required name for the contributors and testers files to `CONTRIBUTORS` and `TESTERS` respectively. Renamed the existing `contrib.txt` and `testers.txt` files accordingly.
- * Made support for REML v4 an official requirement.
- * Dropped support for conditional inclusion of code in .ini files.
-* Added documentation:
- * Of the collection file format.
- * A read-me file.
- * This change log.
-* Ensured that all files in the collection use the UTF-8 text file preamble (aka byte order mark).
-* Added a shell script to create releases.
-* Officially adopted the MIT license for source code files.
diff --git a/csdb/README.md b/csdb/README.md
deleted file mode 100644
index 265c9f3..0000000
--- a/csdb/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-# DelphiDabbler Code Snippets Database v2
-
-This collection is version 2 of the DelphiDabbler Code Snippets Database.
-
-The collection contains over 600 reusable Pascal code snippets. The majority are simple functions and procedures but there are also some constants and type definitions, including some advanced records with methods.
-
-All of the snippets have been tested: some received basic testing while others have been tested more comprehensively. The collection contains details of the level of testing each snippet received.
-
-## History
-
-Version 1 was designed exclusively for use with _DelphiDabbler [CodeSnip](https://github.com/delphidabbler/codesnip)_ (v4.15.1 and earlier) and was downloaded by the program directly from a web service on DelphiDabbler.com.
-
-Version 2 is designed to be able to be used by other applications in addition to _CodeSnip_ (v4.16.0 or later). This version is **not** backwards compatible with version 1.
-
-## Using the Collection
-
-Anyone is welcome to write applications or web pages that access the snippets in the collection, subject to the terms of the license (see below). You should read the collection's documentation which explains the file format in detail.
-
-> **WARNING:** Implementers **must not** read the collection data directly from this GitHub repository - that could generate more than the permitted amount of traffic. Instead you must download a release from the _Releases_ tab and either distribute the collection with the application or host it on a web server.
-
-## Documentation
-
-The collection data format is fully documented in the file `collection-format.html` in the `docs` directory.
-
-## Tests
-
-Unit tests and demonstration projects are available for _some_ of the snippets in the database.
-
-Source code for these tests and demonstrations is available in the `tests` directory. There is a sub-directory for each category where such code is available.
-
-See the `README.md` file in the `tests` directory for full details.
-
-## Releases
-
-Releases can be found on the `releases` tab on the GitHub project page.
-
-From v2.0.1, each release comprises three zip files, as follows (replace `X.Y.X` in the file names with the release version number):
-
-* `csdb-vX.Y.Z-data.zip` - Contains all the data in the collection. Required by applications that access the collection.
-* `csdb-vX.Y.Z-docs.zip` - Contains the documentation developers need to understand the structure of the data.
-* `csdb-vX.Y.Z-tests.zip` - Contains the unit tests and demo code.
-
-## Change Log
-
-The project's change log can be found in `CHANGELOG.md` in the collection's base directory.
-
-## License
-
-All snippets in this collection (stored in `.dat` files in the `collections` directory) are licensed under the MIT license and are copyright © 2005-2020, [Peter Johnson](https://gravatar.com/delphidabbler) and Contributors. The full license and a list of contributors can be found in the `LICENSE` and `CONTRIBUTORS` files in the `collection` sub-directory.
-
-Certain files in the `tests` directory contain copies of snippets extracted from the collection. These files are identified as such in the comments at the start of the file. The files are licensed under the same license as the `.dat` files in the `collections` directory. See the paragraph above for details.
-
-All other files in this project are licensed under the MIT license and are copyright © 2020-2021, [Peter Johnson](https://gravatar.com/delphidabbler).
diff --git a/csdb/collection/VERSION b/csdb/collection/VERSION
deleted file mode 100644
index 1ac95c1..0000000
--- a/csdb/collection/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-2.1.1
diff --git a/csdb/collection/maths.ini b/csdb/collection/maths.ini
deleted file mode 100644
index a55b2f6..0000000
--- a/csdb/collection/maths.ini
+++ /dev/null
@@ -1,1410 +0,0 @@
-# DelphiDabbler Code Snippets Database v2
-#
-# Mathematics category file
-#
-# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
-# https://gravatar.com/delphidabbler
-
-[AllDigitsDifferent]
-DescEx="Checks if all the digits of the given integer are different to each other.
"
-Extra="An example of an integer with all digits different is 15862.
"
-SeeAlso=AllDigitsSame
-Snip=498.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[AllDigitsSame]
-DescEx="Checks if all the digits of the given integer are the same.
"
-Extra="An example of an integer with all digits the same is 777777.
"
-SeeAlso=AllDigitsDifferent,RepeatedDigits
-Snip=499.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[DigitCount]
-DescEx="Counts the number of digits in the given integer.
"
-Extra="Contributed by Bill Miller.
"
-SeeAlso=DigitCount2,DigitCountR
-TestInfo=advanced
-Snip=202.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[DigitCount2]
-DescEx="Counts the number of digits in the given integer.
"
-Extra="Based on code suggested by Don Rowlett.
"
-Units=Math
-SeeAlso=DigitCount,DigitCountR
-TestInfo=advanced
-Snip=204.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[DigitCountR]
-DescEx="Counts the number of digits in the given integer using recursion.
"
-Extra="Contributed by Rubem Nascimento da Rocha.
"
-SeeAlso=DigitCount,DigitCount2
-TestInfo=advanced
-Snip=417.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[Factorial]
-DescEx="Calculates the factorial of the given number.
"
-Extra="Adapted from code contributed by Don Rowlett.
"
-Snip=231.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[IsRectNormal]
-DescEx="Checks if the given rectangle is normalized, i.e. Left <= Right and Top <= Bottom .
"
-Units=Windows
-SeeAlso=NormalizeRect
-Snip=124.dat
-Delphi2=Y
-Delphi3=Y
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[MoveRectToOrigin]
-DescEx="Translates the give rectangle to the origin.
The top and left co-ordinates are set to zero and the bottom and right co-ordinates are adjusted accordingly.
"
-Units=Types
-Snip=373.dat
-Delphi2=N
-Delphi3=N
-Delphi4=N
-Delphi5=Q
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[NormalizeRect]
-DescEx="Normalises the given rectangle so that Left <= Right and Top <= Bottom .
"
-Extra="Inspired by code published by Marco Cantù in supplementary chapter 22 of Mastering Delphi 5.
"
-Units=Windows
-Depends=ExchangeInt
-SeeAlso=IsRectNormal
-Snip=125.dat
-Delphi2=Y
-Delphi3=Y
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[RectArea]
-DescEx="Returns the area of the given rectangle.
"
-Extra="Adopts the convention that the rectangle's bottom and right are not included in it, so that width = right - left and height = bottom - top.
"
-SeeAlso=RectHeight,RectSize,RectWidth
-Units=Windows
-Snip=496.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-
-[RectHeight]
-DescEx="Returns the height of the given rectangle.
The return value is always non-negative even if the rectangle is not normalized.
"
-Extra="Adopts the convention that the rectangle's bottom and right are not included in it, so that height = bottom - top.
"
-Units=Windows
-SeeAlso=RectSize,RectWidth,NormalizeRect
-Snip=127.dat
-Delphi2=Y
-Delphi3=Y
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[RectSize]
-DescEx="Returns the size of the given rectangle.
The returned dimensions are always non-negative even if the rectangle is not normalized.
"
-Extra="Adopts the convention that the rectangle's bottom and right are not included in it, so that width = right - left and height = bottom - top.
"
-Units=Windows
-Depends=RectWidth,RectHeight
-SeeAlso=RectWidth,RectHeight,NormalizeRect
-Snip=128.dat
-Delphi2=Y
-Delphi3=Y
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[RectWidth]
-DescEx="Returns the width of the given rectangle.
The return value is always non-negative even if the rectangle is not normalized.
"
-Extra="Adopts the convention that the rectangle's bottom and right are not included in it, so that width = right - left.
"
-Units=Windows
-SeeAlso=RectSize,RectHeight,NormalizeRect
-Snip=126.dat
-Delphi2=Y
-Delphi3=Y
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[RepeatedDigits]
-DescEx="Checks if the given integer contains only a single repeated digit.
"
-Extra="An example of an integer with a single repeated digit is 5555.
Slightly modified from code contributed by Rubem Rocha.
"
-Units=SysUtils,Math
-SeeAlso=AllDigitsSame
-Snip=497.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[ReverseNumber]
-DescEx="Reverses the digits of integer AValue and returns the resulting value.
AValue should be positive: zero is always returned for negative integers.
"
-Extra="Contributed by Rubem Nascimento da Rocha.
"
-SeeAlso=ReverseNumberR
-Snip=405.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[SignOfFloat]
-DescEx="Returns the sign of the given floating point value. Returns -1 if the value is positive, 0 if zero or +1 if negative.
"
-Extra="Contributed by Bill Miller.
"
-SeeAlso=SignOfInt
-Snip=205.dat
-Delphi2=Y
-Delphi3=Y
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[SignOfInt]
-DescEx="Returns the sign of the given integer. Returns -1 if the integer is positive, 0 if zero or +1 if negative.
"
-Extra="Contributed by Bill Miller.
"
-SeeAlso=SignOfFloat
-Snip=206.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[DecimalToFraction]
-DescEx="Converts the given decimal to a fraction. The numerator and denominator are passed out as floating point numbers in FractionNumerator and FractionDenominator respectively.
AccuracyFactor determines how accurate the conversion is to be.
"
-Extra="Examples of AccuracyFactor values: 0.0005 requires accuracy of 3 decimal places and 0.000005 requires accuracy of 5 decimal places.
Adapted from the Turbo Pascal code by John Kennedy, Mathematics Department, Santa Monica College.
"
-Units=SysUtils,Math
-Snip=468.dat
-Delphi2=N
-Delphi3=N
-Delphi4=N
-Delphi5=N
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[DigitSum]
-DescEx="Returns the sum of the digits from the given integer, using recursion.
"
-Extra="Sums of digits of negative numbers are negative, for example DigitSum(-42)=-6 .
Contributed Rubem Nascimento da Rocha.
"
-TestInfo=advanced
-Snip=418.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[DistanceBetweenPoints_Float]
-DisplayName="DistanceBetweenPoints (TPointF overload)"
-DescEx="Calculates the distance between two given points with double precision floating point valued coordinates.
"
-Depends=TPointF
-SeeAlso=DistanceBetweenPoints_Int
-Units=Math
-Snip=495.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[DistanceBetweenPoints_Int]
-DisplayName="DistanceBetweenPoints (TPoint overload)"
-DescEx="Calculates the distance between two points with integer valued co-ordinates.
"
-SeeAlso=DistanceBetweenPoints_Float
-Units=Math,Types
-Snip=494.dat
-Delphi2=N
-Delphi3=N
-Delphi4=N
-Delphi5=N
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[GCD]
-DescEx="Determines the greatest common divisor of two given non-zero integers.
"
-Extra="Uses Euclid's method.
Note that GCD(a,b) = GCD(|a|,b) = GCD(a,|b|) = GCD(|a|,|b|) , which implies that GCD(a,b) is always positive.
Modified from code by Hans van Kruijssen.
"
-SeeAlso=GCD2,LCD
-TestInfo=advanced
-Snip=201.dat
-Delphi2=Y
-Delphi3=Y
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[GCD2]
-DescEx="Determines the greatest common divisor of two given non-zero integers.
"
-Extra="Uses a recursive implementation of Euclid's method.
Note that GCD2(a,b) = GCD2(|a|,b) = GCD2(a,|b|) = GCD2(|a|,|b|) , which implies that GCD2(a,b) is always positive.
Modified from code by Hans van Kruijssen.
"
-SeeAlso=GCD,LCD
-TestInfo=advanced
-Snip=416.dat
-Delphi2=Y
-Delphi3=Y
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[IsPrime]
-DescEx="Checks if the given number is prime.
"
-Extra="On versions of Delphi that support Int64 parameters to the Sqrt function, the type of N , Max & Divisor can be changed to Int64 .
Adapted from code contributed by Don Rowlett.
"
-SeeAlso=IsPrime2
-TestInfo=advanced
-Snip=232.dat
-Delphi2=Y
-Delphi3=Y
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[IsPrime2]
-DescEx="Checks if the given number is prime.
"
-Extra="Uses less code than IsPrime and does not require any floating point operations.
Contributed by daniel.
"
-SeeAlso=IsPrime
-TestInfo=advanced
-Snip=570.dat
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[LCD]
-DescEx="Returns the least common divisor of two given non-zero integers.
"
-Extra="Note that LCD(a,b) = LCD(|a|,b) = LCD(a,|b|) = LCD(|a|,|b|) , which implies that LCD(a,b) is always positive.
Modified from code by Hans van Kruijssen.
"
-Depends=GCD
-SeeAlso=GCD,GCD2
-TestInfo=advanced
-Snip=467.dat
-Delphi2=Y
-Delphi3=Y
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[MaxOfArray_Double]
-DisplayName="MaxOfArray (Double overload)"
-DescEx="Returns the maximum value contained in the given array of double precision floating point values.
The array must not be empty.
"
-SeeAlso=MinOfArray_Double,MaxOfArray_Extended,MaxOfArray_Int64,MaxOfArray_Integer,MaxOfArray_Single,Mid_Double,MinMidMax_Double
-TestInfo=advanced
-Snip=428.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[MaxOfArray_Extended]
-DisplayName="MaxOfArray (Extended overload)"
-DescEx="Returns the maximum value contained in the given array of extended precision floating point values.
The array must not be empty.
"
-SeeAlso=MinOfArray_Extended,MaxOfArray_Double,MaxOfArray_Int64,MaxOfArray_Integer,MaxOfArray_Single,Mid_Extended,MinMidMax_Extended
-TestInfo=advanced
-Snip=429.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[MaxOfArray_Int64]
-DisplayName="MaxOfArray (Int64 overload)"
-DescEx="Returns the maximum value contained in the given array of 64 bit integer values.
The array must not be empty.
"
-SeeAlso=MinOfArray_Int64,MaxOfArray_Double,MaxOfArray_Extended,MaxOfArray_Integer,MaxOfArray_Single,Mid_Int64,MinMidMax_Int64
-TestInfo=advanced
-Snip=430.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[MaxOfArray_Integer]
-DisplayName="MaxOfArray (Integer overload)"
-DescEx="Returns the maximum value contained in the given array of integer values.
The array must not be empty.
"
-SeeAlso=MinOfArray_Integer,MaxOfArray_Double,MaxOfArray_Extended,MaxOfArray_Int64,MaxOfArray_Single,Mid_Integer,MinMidMax_Integer
-TestInfo=advanced
-Snip=431.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[MaxOfArray_Single]
-DisplayName="MaxOfArray (Single overload)"
-DescEx="Returns the maximum value contained in the given array of single precision floating point values.
The array must not be empty.
"
-SeeAlso=MinOfArray_Single,MaxOfArray_Double,MaxOfArray_Extended,MaxOfArray_Int64,MaxOfArray_Integer,Mid_Single,MinMidMax_Single
-TestInfo=advanced
-Snip=432.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[Mid_Double]
-DisplayName="Mid (Double overload)"
-DescEx="Returns the middle of three double precision floating point values.
"
-Units=Math
-SeeAlso=Mid_Extended,Mid_Int64,Mid_Integer,Mid_Single,MaxOfArray_Double,MinOfArray_Double,MinMidMax_Double
-TestInfo=advanced
-Snip=423.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[Mid_Extended]
-DisplayName="Mid (Extended overload)"
-DescEx="Returns the middle of three extended precision floating point values.
"
-Extra="Adapted from code from Bill Miller's snippets collection.
"
-Units=Math
-SeeAlso=Mid_Double,Mid_Int64,Mid_Integer,Mid_Single,MaxOfArray_Extended,MinOfArray_Extended,MinMidMax_Extended
-TestInfo=advanced
-Snip=424.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[Mid_Int64]
-DisplayName="Mid (Int64 overload)"
-DescEx="Returns the middle of three 64 bit integer values.
"
-Units=Math
-SeeAlso=Mid_Double,Mid_Extended,Mid_Integer,Mid_Single,MaxOfArray_Int64,MinOfArray_Int64,MinMidMax_Int64
-TestInfo=advanced
-Snip=425.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[Mid_Integer]
-DisplayName="Mid (Integer overload)"
-DescEx="Returns the middle of three integer values.
"
-Extra="Adapted from code from Bill Miller's snippets collection.
"
-Units=Math
-SeeAlso=Mid_Double,Mid_Extended,Mid_Int64,Mid_Single,MaxOfArray_Integer,MinOfArray_Integer,MinMidMax_Integer
-TestInfo=advanced
-Snip=426.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[Mid_Single]
-DisplayName="Mid (Single overload)"
-DescEx="Returns the middle of three single precision floating point values.
"
-Units=Math
-SeeAlso=Mid_Double,Mid_Extended,Mid_Int64,Mid_Integer,MaxOfArray_Single,MinOfArray_Single,MinMidMax_Single
-TestInfo=advanced
-Snip=427.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[MinMidMax_Double]
-DisplayName="MinMidMax (Double overload)"
-DescEx="Finds the minimum, middle and maximum values of three double precision floating point numbers, A , B and C and returns them in Min , Mid and Max respectively.
"
-Extra="Contributed by Bruce Wernick.
"
-SeeAlso=MinMidMax_Extended,MinMidMax_Int64,MinMidMax_Integer,MinMidMax_Single,Mid_Double,MaxOfArray_Double,MinOfArray_Double
-Snip=472.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[MinMidMax_Extended]
-DisplayName="MinMidMax (Extended overload)"
-DescEx="Finds the minimum, middle and maximum values of three extended precision floating point numbers, A , B and C and returns them in Min , Mid and Max respectively.
"
-Extra="Adapted from code contributed by Bruce Wernick.
"
-SeeAlso=MinMidMax_Double,MinMidMax_Int64,MinMidMax_Integer,MinMidMax_Single,Mid_Extended,MaxOfArray_Extended,MinOfArray_Extended
-Snip=473.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[MinMidMax_Int64]
-DisplayName="MinMidMax (Int64 overload)"
-DescEx="Finds the minimum, middle and maximum values of three 64 bit integers, A , B and C and returns them in Min , Mid and Max respectively.
"
-Extra="Adapted from code contributed by Bruce Wernick.
"
-SeeAlso=MinMidMax_Double,MinMidMax_Extended,MinMidMax_Integer,MinMidMax_Single,Mid_Int64,MaxOfArray_Int64,MinOfArray_Int64
-Snip=474.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[MinMidMax_Integer]
-DisplayName="MinMidMax (Integer overload)"
-DescEx="Finds the minimum, middle and maximum values of three integers, A , B and C and returns them in Min , Mid and Max respectively.
"
-Extra="Adapted from code contributed by Bruce Wernick.
"
-SeeAlso=MinMidMax_Double,MinMidMax_Extended,MinMidMax_Int64,MinMidMax_Single,Mid_Integer,MaxOfArray_Integer,MinOfArray_Integer
-Snip=475.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[MinMidMax_Single]
-DisplayName="MinMidMax (Single overload)"
-DescEx="Finds the minimum, middle and maximum values of three single precision floating point numbers, A , B and C and returns them in Min , Mid and Max respectively.
"
-Extra="Adapted from code contributed by Bruce Wernick.
"
-SeeAlso=MinMidMax_Double,MinMidMax_Extended,MinMidMax_Int64,MinMidMax_Integer,Mid_Single,MaxOfArray_Single,MinOfArray_Single
-Snip=476.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[MinOfArray_Double]
-DisplayName="MinOfArray (Double overload)"
-DescEx="Returns the minimum value contained in the given array of double precision floating point values.
The array must not be empty.
"
-SeeAlso=MaxOfArray_Double,MinOfArray_Extended,MinOfArray_Int64,MinOfArray_Integer,MinOfArray_Single,Mid_Double,MinMidMax_Double
-TestInfo=advanced
-Snip=433.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[MinOfArray_Extended]
-DisplayName="MinOfArray (Extended overload)"
-DescEx="Returns the minimum value contained in the given array of extended precision floating point values.
The array must not be empty.
"
-SeeAlso=MaxOfArray_Extended,MinOfArray_Double,MinOfArray_Int64,MinOfArray_Integer,MinOfArray_Single,Mid_Extended,MinMidMax_Extended
-TestInfo=advanced
-Snip=434.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[MinOfArray_Int64]
-DisplayName="MinOfArray (Int64 overload)"
-DescEx="Returns the minimum value contained in the given array of 64 bit integer values.
The array must not be empty.
"
-SeeAlso=MaxOfArray_Int64,MinOfArray_Double,MinOfArray_Extended,MinOfArray_Integer,MinOfArray_Single,Mid_Int64,MinMidMax_Int64
-TestInfo=advanced
-Snip=435.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[MinOfArray_Integer]
-DisplayName="MinOfArray (Integer overload)"
-DescEx="Returns the minimum value contained in the given array of integer values.
The array must not be empty.
"
-SeeAlso=MaxOfArray_Integer,MinOfArray_Double,MinOfArray_Extended,MinOfArray_Int64,MinOfArray_Single,Mid_Integer,MinMidMax_Integer
-TestInfo=advanced
-Snip=436.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[MinOfArray_Single]
-DisplayName="MinOfArray (Single overload)"
-DescEx="Returns the minimum value contained in the given array of single precision floating point values.
The array must not be empty.
"
-SeeAlso=MaxOfArray_Single,MinOfArray_Double,MinOfArray_Extended,MinOfArray_Int64,MinOfArray_Integer,Mid_Single,MinMidMax_Single
-TestInfo=advanced
-Snip=437.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[NormaliseFractionSign]
-DescEx="Normalises the sign of the fraction with numerator Num and denominator Denom so that Num takes the sign of the fraction and Denom is non-negative.
"
-SeeAlso=FractionToStr,FractionToStrEx
-Snip=559.dat
-Delphi2=Y
-Delphi3=Y
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[Pow]
-DescEx="Raises integer value Base to non-negative integer power Exponent and returns the result.
"
-Snip=561.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[ResizeRect_A]
-DisplayName="ResizeRect (TSize overload)"
-DescEx="Resizes rectangle R to size NewSize , leaving the top-left position unchanged.
Returns the resized rectangle.
"
-Units=Types
-Depends=ResizeRect_B
-SeeAlso=ResizeRect_B,StretchRect_A,StretchRect_B,ScaleRect,ZoomRatio_A,ZoomRatio_B,ZoomRatio_C
-TestInfo=advanced
-Snip=420.dat
-Delphi2=N
-Delphi3=N
-Delphi4=N
-Delphi5=N
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[ResizeRect_B]
-DisplayName="ResizeRect (Longint overload)"
-DescEx="Resizes rectangle R to the width and height given by NewWidth and NewHeight , leaving the top-left position unchanged.
Returns the resized rectangle.
"
-Units=Types
-SeeAlso=ResizeRect_A,StretchRect_A,StretchRect_B,ScaleRect,ZoomRatio_A,ZoomRatio_B,ZoomRatio_C
-TestInfo=advanced
-Snip=419.dat
-Delphi2=N
-Delphi3=N
-Delphi4=N
-Delphi5=N
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[ReverseNumberR]
-DescEx="Reverses the digits of the given integer, which must be non-negative, and returns the resulting value.
Uses recursion.
"
-Extra="Users of Delphi 7 and later can change the parameter and return type to UInt64 and remove the assertion.
Slightly modified from code contributed by Rubem Nascimento da Rocha.
"
-Units=Math
-SeeAlso=ReverseNumber
-Snip=406.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[SAR]
-DescEx="Performs an arithmetic right shift operation on the given value and returns the result. Value is shifted right by Shift bits.
Shift must be in the range 0..31 and is adjusted if it is not.
"
-Extra="SAR differs from the shr operator in that it preserves any sign bit.
For more information about the different kinds of right shift operator, see this blog post .
"
-Snip=560.dat
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[ScaleRect]
-DescEx="Scales the given rectangle by the given scale factor and returns the scaled rectangle.
"
-Extra="Slightly modified from code contributed by Montor.
"
-Units=Types
-SeeAlso=ZoomRatio_A,ZoomRatio_B,ZoomRatio_C,StretchRect_A,StretchRect_B,ResizeRect_A,ResizeRect_B
-Snip=383.dat
-Delphi2=N
-Delphi3=N
-Delphi4=N
-Delphi5=N
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[SimplifyFraction]
-DescEx="Simplifies the fraction with numerator Num and denominator Denom to its lowest terms.
If the fraction is already in its lowest terms then Num and Denom are left unchanged.
"
-Depends=GCD
-SeeAlso=DecimalToFraction,NormaliseFractionSign
-Snip=621.dat
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[StretchRect_A]
-DisplayName="StretchRect (asymmetric overload)"
-DescEx="Stretches rectangle R by the given scaling factors and returns the result.
The rectangle's width is scaled by ScalingX and its height by ScalingY .
The top left corner of the rectangle is not changed.
"
-Units=SysUtils,Types
-SeeAlso=StretchRect_B,ScaleRect,ResizeRect_A,ResizeRect_B,ZoomRatio_A,ZoomRatio_B,ZoomRatio_C
-TestInfo=advanced
-Snip=421.dat
-Delphi2=N
-Delphi3=N
-Delphi4=N
-Delphi5=N
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[StretchRect_B]
-DisplayName="StretchRect (symmetric overload)"
-DescEx="Stretches the rectangle R by scale factor Scaling and returns the result. Both width and height are stretched by the same scale factor.
The top left corner is not changed.
"
-Units=Types
-Depends=StretchRect_A
-SeeAlso=StretchRect_A,ScaleRect,ResizeRect_A,ResizeRect_B,ZoomRatio_A,ZoomRatio_B,ZoomRatio_C
-TestInfo=advanced
-Snip=422.dat
-Delphi2=N
-Delphi3=N
-Delphi4=N
-Delphi5=N
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[ZoomRatio_A]
-DisplayName="ZoomRatio (Integer overload)"
-DescEx="Calculates and returns the largest scaling that can be applied to a rectangle of width SrcWidth and height SrcHeight to fit it, without changing the aspect ratio, within a second rectangle of width DestWidth and height DestHeight .
"
-Extra="Slightly modified from code contributed by Montor.
"
-Units=Math
-SeeAlso=ZoomRatio_B,ZoomRatio_C,ScaleRect,StretchRect_A,StretchRect_B,ResizeRect_A,ResizeRect_B
-Snip=376.dat
-Delphi2=N
-Delphi3=N
-Delphi4=Y
-Delphi5=Y
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[ZoomRatio_B]
-DisplayName="ZoomRatio (TSize overload)"
-DescEx="Calculates and returns the largest scaling that can be applied to a rectangle of size SrcSize to fit it, without changing the aspect ratio, within a second rectangle of size DestSize .
"
-Units=Types
-Depends=ZoomRatio_A
-SeeAlso=ZoomRatio_A,ZoomRatio_C,ScaleRect,StretchRect_A,StretchRect_B,ResizeRect_A,ResizeRect_B
-Snip=377.dat
-Delphi2=N
-Delphi3=N
-Delphi4=N
-Delphi5=N
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
-
-[ZoomRatio_C]
-DisplayName="ZoomRatio (TRect overload)"
-DescEx="Calculates and returns the largest scaling that can be applied to rectangle SrcRect to fit it, without changing the aspect ratio, within rectangle DestRect .
"
-Units=Types
-Depends=RectSize,ZoomRatio_B
-SeeAlso=ZoomRatio_A,ZoomRatio_B,ScaleRect,StretchRect_A,StretchRect_B,ResizeRect_A,ResizeRect_B
-Snip=378.dat
-Delphi2=N
-Delphi3=N
-Delphi4=N
-Delphi5=N
-Delphi6=Y
-Delphi7=Y
-Delphi2005Win32=Y
-Delphi2006Win32=Y
-Delphi2007=Y
-Delphi2009Win32=Y
-Delphi2010=Y
-DelphiXE=Y
-DelphiXE2=Y
-DelphiXE3=Y
-DelphiXE4=Y
-Delphi10S=Y
-FPC=Y
diff --git a/csdb/docs/reml.html b/csdb/docs/reml.html
deleted file mode 100644
index 1699547..0000000
--- a/csdb/docs/reml.html
+++ /dev/null
@@ -1,251 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- DelphiDabbler Code Snippets Database Docs - REML
-
-
-
-
-
-
-
-
-
-
-
- Introduction
-
-
-
- REML is a little markup language that can be used to style text. It is used in the Code Snippets collection's meta data for certain properties of a snippet.
-
-
- The REML language is a SGML language similar to a greatly simplified XHTML. The are a small number of tags and character entities that can be used.
-
-
- Note: The language described here is REML v4. Earlier versions are obsolete.
-
-
-
-
-
-
- From v2.1.0 of the collection all REML is fully conformant and REML interpreters designed only for v2.1.0 or later are not required to handle text with enclosing tags.
-
-
-
-
- Inline Tags
-
-
-
- In-line tags format the text enclosed between the start and end tags.
-
-
- Here are the available in-line tags:
-
-
-
- <strong>...</strong> – Renders the enclosed markup with strong emphasis.
-
-
- <em>...</em> – Emphasises the enclosed markup.
-
-
- <var>...</var> – Used to indicate the enclosed markup is a variable.
-
-
- <warning>...</warning> – Used for warning text.
-
-
- <mono>...</mono> – Renders markup in a mono-spaced font.
-
-
- <a href="https://github.com/url">...</a> – Creates a hyper-link. The href attribute must specify the required URL, which must use one of the http, https or file protocols; others are not permitted. If you use the file protocol it must reference a valid local or network file.
-
-
-
- The following rules apply to the use of in-line tags:
-
-
-
- In-line tags must be embedded inside a block level tag. E.g. <p>one<strong>two</strong>three</p>. However those REML interpreters that allow for the omission of some block level tags relax this restriction (see above).
-
-
- Tags must match. E.g. <em> must be matched with </em>.
-
-
- Tags may be nested, providing the tags match. E.g. <em>blah <var>blah</var></em> is valid but <em>blah <var>blah</em></var> is not.
-
-
-
- Examples:
-
- <p>Make stuff <strong>stand out</strong>.</p>
-<p><em>Emphasised <warning>warning!</warning></em></p>
-<p>Refer to a function <var>parameter</var>.</p>
-<p>Use the: <mono>Windows</mono> unit.</p>
-<p>See this <a href="http://example.com/">example</a>.</p>
-
-
-
-
-
-
- Character Entities
-
-
-
- A few symbolic character entities are supported in REML. Here is the complete list:
-
-
-
- < for <
-
-
- > for >
-
-
- " for "
-
-
- & for &
-
-
- © for ©
-
-
-
-
- Note: the '<' and '&' characters are special within the markup and cannot be used literally. You must use the < character entity in place of < and & instead of &. For example to write x<y in REML use x<y and to write you & me use you & me.
-
-
-
- To express other special symbols for which there is no symbolic character entity, numeric character entities can be used. For example to display the '¶' character (Unicode pilcrow sign ) use ¶.
-
-
-
- Note: Numeric entities should be used with caution because the characters they represent may vary across different text encodings, whereas symbolic entities are safe across encodings.
-
-
-
-
-
-
-
-
-
diff --git a/csdb/tests/Cat-Arrays/TestUArraysCatSnippets.pas b/csdb/tests/Cat-Arrays/TestUArraysCatSnippets.pas
deleted file mode 100644
index 9b1e2da..0000000
--- a/csdb/tests/Cat-Arrays/TestUArraysCatSnippets.pas
+++ /dev/null
@@ -1,257 +0,0 @@
-unit TestUArraysCatSnippets;
-
-{$UNDEF Generics}
-{$IFNDEF FPC}
- {$IFDEF CONDITIONALEXPRESSIONS}
- {$IF CompilerVersion >= 14.00}
- {$WARN SYMBOL_PLATFORM OFF}
- {$WARN SYMBOL_DEPRECATED OFF}
- {$WARN SYMBOL_LIBRARY OFF}
- {$IFEND}
- {$IF CompilerVersion >= 15.00}
- {$WARN UNSAFE_TYPE OFF}
- {$WARN UNSAFE_CAST OFF}
- {$WARN UNSAFE_CODE OFF}
- {$IFEND}
- {$IF CompilerVersion >= 20.00}
- {$WARN EXPLICIT_STRING_CAST OFF}
- {$WARN IMPLICIT_STRING_CAST OFF}
- {$DEFINE Generics}
- {$IFEND}
- {$ENDIF}
-{$ENDIF}
-
-interface
-
-uses
- TestFramework, UArraysCatSnippets;
-
-type
-
- {$IFDEF Generics}
- TestTArrayUtils = class(TTestCase)
- strict private
- fSA0: TArray;
- fSA1: TArray;
- fSA2: TArray;
- fSAM: TArray;
- fSAN: TArray;
- fIA0: TArray;
- fIA1: TArray;
- fIA2: TArray;
- fIAM: TArray;
- fIAN: TArray;
- fIAP: TArray;
- fIAX: TArray;
- fIAY: TArray;
- protected
- procedure SetUp; override;
- procedure TearDown; override;
- published
- procedure TestFirst;
- procedure TestLast;
- procedure TestIndexOf;
- procedure TestEqual;
- procedure TestSameStart;
- end;
- {$ENDIF Generics}
-
- TestArraysCatSnippets = class(TTestCase)
-
- end;
-
-implementation
-
-uses
- SysUtils
- {$IFDEF Generics}
- , Generics.Defaults
- {$ENDIF Generics}
- ;
-
-{$IFDEF Generics}
-var
- IntegerCompareFn: TEqualityComparison;
- StringCompareFn: TEqualityComparison;
-{$ENDIF Generics}
-
-{$IFDEF Generics}
-
-{ TestTArrayUtils }
-
-procedure TestTArrayUtils.SetUp;
-begin
- fSA0 := TArray.Create();
- fSA1 := TArray.Create('foo');
- fSA2 := TArray.Create('foo', 'bar');
- fSAM := TArray.Create('a', 'stitch', 'in', 'time', 'saves', 'nine');
- fSAN := TArray.Create('a', 'stitch', 'in', 'time', 'saves', 'nine');
- fIA0 := TArray.Create();
- fIA1 := TArray.Create(42);
- fIA2 := TArray.Create(42, 56);
- fIAM := TArray.Create(1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37);
- fIAN := TArray.Create(1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37);
- fIAP := TArray.Create(1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29);
- fIAX := TArray.Create(1, 2, 3, 5, 4, 11, 13, 17, 19, 23, 29, 31);
- fIAY := TArray.Create(0, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37);
-end;
-
-procedure TestTArrayUtils.TearDown;
-begin
-
-end;
-
-procedure TestTArrayUtils.TestEqual;
-begin
- CheckTrue(
- TArrayUtils.Equal(fIAM, fIAN, IntegerCompareFn), 'Test 1'
- );
- CheckFalse(
- TArrayUtils.Equal(fIAM, fIAP, IntegerCompareFn), 'Test 2'
- );
- CheckFalse(
- TArrayUtils.Equal(fIAM, fIAX, IntegerCompareFn), 'Test 3'
- );
- CheckFalse(
- TArrayUtils.Equal(fIAM, fIAY, IntegerCompareFn), 'Test 4'
- );
- CheckFalse(
- TArrayUtils.Equal(fIAM, fIA0, IntegerCompareFn), 'Test 5'
- );
- CheckTrue(
- TArrayUtils.Equal(fIA0, fIA0, IntegerCompareFn), 'Test 6'
- );
- CheckTrue(
- TArrayUtils.Equal(fSAM, fSAN, StringCompareFn), 'Test 7'
- );
- CheckFalse(
- TArrayUtils.Equal(fSA1, fSA2, StringCompareFn), 'Test 8'
- );
-end;
-
-procedure TestTArrayUtils.TestFirst;
-begin
- CheckEquals('foo', TArrayUtils.First(fSA1), 'Test 1');
- CheckEquals('foo', TArrayUtils.First(fSA2), 'Test 2');
- CheckEquals('a', TArrayUtils.First(fSAN), 'Test 3');
- CheckEquals(42, TArrayUtils.First(fIA1), 'Test 4');
- CheckEquals(42, TArrayUtils.First(fIA2), 'Test 5');
- CheckEquals(1, TArrayUtils.First(fIAN), 'Test 6');
-end;
-
-procedure TestTArrayUtils.TestIndexOf;
-begin
- CheckEquals(
- -1, TArrayUtils.IndexOf('foo', fSA0, StringCompareFn), 'Test 1'
- );
- CheckEquals(
- 0, TArrayUtils.IndexOf('foo', fSA1, StringCompareFn), 'Test 2'
- );
- CheckEquals(
- 0, TArrayUtils.IndexOf('foo', fSA2, StringCompareFn), 'Test 3'
- );
- CheckEquals(
- -1, TArrayUtils.IndexOf('foo', fSAN, StringCompareFn), 'Test 4'
- );
- CheckEquals(
- 5, TArrayUtils.IndexOf('nine', fSAN, StringCompareFn), 'Test 5'
- );
- CheckEquals(
- -1, TArrayUtils.IndexOf(42, fIA0, IntegerCompareFn), 'Test 6'
- );
- CheckEquals(
- 0, TArrayUtils.IndexOf(42, fIA1, IntegerCompareFn), 'Test 7'
- );
- CheckEquals(
- 1, TArrayUtils.IndexOf(56, fIA2, IntegerCompareFn), 'Test 8'
- );
- CheckEquals(
- 7, TArrayUtils.IndexOf(17, fIAN, IntegerCompareFn), 'Test 9'
- );
- CheckEquals(
- -1, TArrayUtils.IndexOf(42, fIAN, IntegerCompareFn), 'Test 10'
- );
-end;
-
-procedure TestTArrayUtils.TestLast;
-begin
- CheckEquals('foo', TArrayUtils.Last(fSA1), 'Test 1');
- CheckEquals('bar', TArrayUtils.Last(fSA2), 'Test 2');
- CheckEquals('nine', TArrayUtils.Last(fSAN), 'Test 3');
- CheckEquals(42, TArrayUtils.Last(fIA1), 'Test 4');
- CheckEquals(56, TArrayUtils.Last(fIA2), 'Test 5');
- CheckEquals(37, TArrayUtils.Last(fIAN), 'Test 6');
-end;
-
-procedure TestTArrayUtils.TestSameStart;
-begin
- CheckTrue(
- TArrayUtils.SameStart(fSA1, fSA2, 1, StringCompareFn), 'Test 1'
- );
- CheckFalse(
- TArrayUtils.SameStart(fSA1, fSA2, 2, StringCompareFn), 'Test 2'
- );
- CheckTrue(
- TArrayUtils.SameStart(fSA1, fSA2, 1, StringCompareFn), 'Test 3'
- );
- CheckTrue(
- TArrayUtils.SameStart(fSAM, fSAN, 5, StringCompareFn), 'Test 4'
- );
- CheckTrue(
- TArrayUtils.SameStart(fSAM, fSAN, 6, StringCompareFn), 'Test 5'
- );
- CheckFalse(
- TArrayUtils.SameStart(fSAM, fSAN, 7, StringCompareFn), 'Test 6'
- );
- CheckTrue(
- TArrayUtils.SameStart(fIAN, fIAP, 11, IntegerCompareFn), 'Test 7'
- );
- CheckFalse(
- TArrayUtils.SameStart(fIAN, fIAP, 12, IntegerCompareFn), 'Test 8'
- );
- CheckTrue(
- TArrayUtils.SameStart(fIAP, fIAX, 4, IntegerCompareFn), 'Test 9'
- );
- CheckFalse(
- TArrayUtils.SameStart(fIAP, fIAX, 5, IntegerCompareFn), 'Test 10'
- );
- CheckTrue(
- TArrayUtils.SameStart(fIAM, fIAN, 1, IntegerCompareFn), 'Test 11'
- );
- CheckFalse(
- TArrayUtils.SameStart(fIAX, fIAY, 1, IntegerCompareFn), 'Test 12'
- );
- CheckFalse(
- TArrayUtils.SameStart(fIA0, fIA0, 1, IntegerCompareFn), 'Test 13'
- );
- CheckFalse(
- TArrayUtils.SameStart(fIA0, fIAM, 2, IntegerCompareFn), 'Test 14'
- );
-end;
-
-{$ENDIF Generics}
-
-initialization
-
-{$IFDEF Generics}
-
-IntegerCompareFn := function (const Left, Right: Integer): Boolean
- begin
- Result := Left = Right;
- end;
-
-StringCompareFn := function (const Left, Right: string): Boolean
- begin
- Result := SameStr(Left, Right);
- end;
-
-{$ENDIF Generics}
-
- // Register any test cases with the test runner
-{$IFDEF Generics}
-RegisterTest(TestTArrayUtils.Suite);
-{$ENDIF Generics}
-RegisterTest(TestArraysCatSnippets.Suite);
-
-end.
-
diff --git a/csdb/tests/Cat-Arrays/UArraysCatSnippets.pas b/csdb/tests/Cat-Arrays/UArraysCatSnippets.pas
deleted file mode 100644
index 09058f9..0000000
--- a/csdb/tests/Cat-Arrays/UArraysCatSnippets.pas
+++ /dev/null
@@ -1,125 +0,0 @@
-{
- * This file was generated from the DelphiDabbler Code Snippets Database.
- * The source code is licensed under the MIT license, copyright © 2005-2021,
- * Peter Johnson (https://gravatar.com/delphidabbler) and Contributors. The
- * full license and a list of contributors can be found in the `LICENSE` and
- * `CONTRIBUTORS` files at
- * https://github.com/delphidabbler/code-snippets/tree/master/csdb/collection
-}
-
-unit UArraysCatSnippets;
-
-{$UNDEF Generics}
-{$IFNDEF FPC}
- {$IFDEF CONDITIONALEXPRESSIONS}
- {$IF CompilerVersion >= 14.00}
- {$WARN SYMBOL_PLATFORM OFF}
- {$WARN SYMBOL_DEPRECATED OFF}
- {$WARN SYMBOL_LIBRARY OFF}
- {$IFEND}
- {$IF CompilerVersion >= 15.00}
- {$WARN UNSAFE_TYPE OFF}
- {$WARN UNSAFE_CAST OFF}
- {$WARN UNSAFE_CODE OFF}
- {$IFEND}
- {$IF CompilerVersion >= 20.00}
- {$WARN EXPLICIT_STRING_CAST OFF}
- {$WARN IMPLICIT_STRING_CAST OFF}
- {$DEFINE Generics}
- {$IFEND}
- {$ENDIF}
-{$ENDIF}
-
-interface
-
-{$IFDEF Generics}
-uses
- Generics.Defaults;
-{$ENDIF}
-
-{$IFDEF Generics}
-type
- TArrayUtils = record
- public
- // Returns first element of given array, which must not be empty.
- class function First(const A: array of T): T; static;
- // Returns last element of given array, which must not be empty.
- class function Last(const A: array of T): T; static;
- // Returns index of given item in given array or -1 if element no in array.
- // Given equality comparer is used to compare array elements with Elem.
- class function IndexOf(const Item: T; const A: array of T;
- const EqualityComparer: Generics.Defaults.TEqualityComparison):
- Integer; static;
- // Checks if two given arrays have the same contents, in same order. Given
- // equality comparer is used to compare array elements.
- class function Equal(const Left, Right: array of T;
- const EqualityComparer: Generics.Defaults.TEqualityComparison):
- Boolean; static;
- // Checks if the first Count elements of the given arrays are the same.
- // Given equality comparer is used to compare array elements.
- class function SameStart(const Left, Right: array of T;
- const Count: Integer;
- const EqualityComparer: Generics.Defaults.TEqualityComparison):
- Boolean; static;
- end;
-{$ENDIF Generics}
-
-implementation
-
-{$IFDEF Generics}
-
-class function TArrayUtils.Equal(const Left, Right: array of T;
- const EqualityComparer: Generics.Defaults.TEqualityComparison): Boolean;
-var
- I: Integer;
-begin
- Result := Length(Left) = Length(Right);
- if Result then
- begin
- for I := 0 to High(Left) do
- if not EqualityComparer(Left[I], Right[I]) then
- Exit(False);
- end
-end;
-
-class function TArrayUtils.First(const A: array of T): T;
-begin
- Assert(Length(A) > 0);
- Result := A[0];
-end;
-
-class function TArrayUtils.IndexOf(const Item: T; const A: array of T;
- const EqualityComparer: Generics.Defaults.TEqualityComparison): Integer;
-var
- Idx: Integer;
-begin
- for Idx := Low(A) to High(A) do
- if EqualityComparer(A[Idx], Item) then
- Exit(Idx);
- Result := -1;
-end;
-
-class function TArrayUtils.Last(const A: array of T): T;
-begin
- Assert(Length(A) > 0);
- Result := A[Pred(Length(A))];
-end;
-
-class function TArrayUtils.SameStart(const Left, Right: array of T;
- const Count: Integer;
- const EqualityComparer: Generics.Defaults.TEqualityComparison): Boolean;
-var
- I: Integer;
-begin
- Assert(Count > 0, 'Count must be >= 1');
- if (Length(Left) < Count) or (Length(Right) < Count) then
- Exit(False);
- for I := 0 to Pred(Count) do
- if not EqualityComparer(Left[I], Right[I]) then
- Exit(False);
- Result := True;
-end;
-
-{$ENDIF Generics}
-
-end.
diff --git a/csdb/tests/Cat-Maths/TestUMathsCatSnippets.pas b/csdb/tests/Cat-Maths/TestUMathsCatSnippets.pas
deleted file mode 100644
index 6553a1b..0000000
--- a/csdb/tests/Cat-Maths/TestUMathsCatSnippets.pas
+++ /dev/null
@@ -1,646 +0,0 @@
-unit TestUMathsCatSnippets;
-
-interface
-
-uses
- Types, Math, TestFramework, UMathsCatSnippets;
-
-type
- TestMathsCatSnippets = class(TTestCase)
- private
- procedure StretchRect_A_Except1;
- procedure StretchRect_A_Except2;
- procedure StretchRect_B_Except;
- published
- procedure TestDigitCount;
- procedure TestDigitCount2;
- procedure TestDigitCountR;
- procedure TestDigitSum;
- procedure TestGCD; // required by LCD
- procedure TestGCD2;
- procedure TestLCD;
- procedure TestIsPrime;
- procedure TestIsPrime2;
- procedure TestMid_Integer;
- procedure TestMid_Int64;
- procedure TestMid_Single;
- procedure TestMid_Double;
- procedure TestMid_Extended;
- procedure TestResizeRect_B; // required by ResizeRect_A
- procedure TestResizeRect_A;
- procedure TestStretchRect_A; // required by StretchRect_B
- procedure TestStretchRect_B;
- procedure TestMinOfArray_Integer;
- procedure TestMinOfArray_Int64;
- procedure TestMinOfArray_Single;
- procedure TestMinOfArray_Double;
- procedure TestMinOfArray_Extended;
- procedure TestMaxOfArray_Integer;
- procedure TestMaxOfArray_Int64;
- procedure TestMaxOfArray_Single;
- procedure TestMaxOfArray_Double;
- procedure TestMaxOfArray_Extended;
- end;
-
-implementation
-
-uses
- SysUtils;
-
-const
- First100Primes: array[1..100] of Int64 = (
- 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
- 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151,
- 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233,
- 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317,
- 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419,
- 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503,
- 509, 521, 523, 541
- );
-
-function RectWidth(const Rect: TRect): Integer;
-begin
- Result := Rect.Right - Rect.Left;
-end;
-
-function RectHeight(const Rect: TRect): Integer;
-begin
- Result := Rect.Bottom - Rect.Top;
-end;
-
-{ TestMathsCatSnippets }
-
-procedure TestMathsCatSnippets.StretchRect_A_Except1;
-var
- R0, R1: TRect;
-begin
- R0 := Rect(10, 40, 50, 100);
- R1 := StretchRect(R0, 1234567890.0, 0.5);
-end;
-
-procedure TestMathsCatSnippets.StretchRect_A_Except2;
-var
- R0, R1: TRect;
-begin
- R0 := Rect(10, 40, 50, 100);
- R1 := StretchRect(R0, 0.5, 1234567890.0);
-end;
-
-procedure TestMathsCatSnippets.StretchRect_B_Except;
-var
- R0, R1: TRect;
-begin
- R0 := Rect(10, 40, 50, 100);
- R1 := StretchRect(R0, 1234567890.0);
-end;
-
-procedure TestMathsCatSnippets.TestDigitCount;
-begin
- CheckEquals(1, DigitCount(0), 'DigitCount(0)');
- CheckEquals(1, DigitCount(1), 'DigitCount(1)');
- CheckEquals(1, DigitCount(9), 'DigitCount(9)');
- CheckEquals(2, DigitCount(12), 'DigitCount(12)');
- CheckEquals(6, DigitCount(123456), 'DigitCount(123456)');
- CheckEquals(10, DigitCount(1234567890), 'DigitCount(1234567890)');
- CheckEquals(1, DigitCount(-1), 'DigitCount(-1)');
- CheckEquals(5, DigitCount(-12345), 'DigitCount(-12345)');
-end;
-
-procedure TestMathsCatSnippets.TestDigitCount2;
-begin
- CheckEquals(1, DigitCount2(0), 'DigitCount2(0)');
- CheckEquals(1, DigitCount2(1), 'DigitCount2(1)');
- CheckEquals(1, DigitCount2(9), 'DigitCount2(9)');
- CheckEquals(2, DigitCount2(12), 'DigitCount2(12)');
- CheckEquals(6, DigitCount2(123456), 'DigitCount2(123456)');
- CheckEquals(10, DigitCount2(1234567890), 'DigitCount2(1234567890)');
- CheckEquals(1, DigitCount2(-1), 'DigitCount2(-1)');
- CheckEquals(5, DigitCount2(-12345), 'DigitCount2(-12345)');
-end;
-
-procedure TestMathsCatSnippets.TestDigitCountR;
-begin
- CheckEquals(1, DigitCountR(0), 'DigitCountR(0)');
- CheckEquals(1, DigitCountR(1), 'DigitCountR(1)');
- CheckEquals(1, DigitCountR(9), 'DigitCountR(9)');
- CheckEquals(2, DigitCountR(12), 'DigitCountR(12)');
- CheckEquals(6, DigitCountR(123456), 'DigitCountR(123456)');
- CheckEquals(10, DigitCountR(1234567890), 'DigitCountR(1234567890)');
- CheckEquals(1, DigitCountR(-1), 'DigitCountR(-1)');
- CheckEquals(5, DigitCountR(-12345), 'DigitCountR(-12345)');
-end;
-
-procedure TestMathsCatSnippets.TestDigitSum;
-begin
- CheckEquals(0, DigitSum(0), 'DigitSum(0)');
- CheckEquals(1, DigitSum(1), 'DigitSum(1)');
- CheckEquals(9, DigitSum(9), 'DigitSum(9)');
- CheckEquals(3, DigitSum(12), 'DigitSum(12)');
- CheckEquals(3, DigitSum(102), 'DigitSum(102)');
- CheckEquals(3, DigitSum(120), 'DigitSum(120)');
- CheckEquals(19, DigitSum(5743), 'DigitSum(5743)');
- CheckEquals(45, DigitSum(987654321), 'DigitSum(987654321)');
- CheckEquals(45, DigitSum(9876543210), 'DigitSum(9876543210)');
- CheckEquals(-19, DigitSum(-5743), 'DigitSum(-5743)');
- CheckEquals(-1, DigitSum(-1), 'DigitSum(-1)');
- CheckEquals(-9, DigitSum(-9), 'DigitSum(-9)');
-end;
-
-procedure TestMathsCatSnippets.TestGCD;
-begin
- CheckEquals(1, GCD(1,1), 'GCD(1,1)');
- CheckEquals(6, GCD(12,6), 'GCD(12,6)');
- CheckEquals(1, GCD(13,7), 'GCD(13,7)');
- CheckEquals(7, GCD(35,7), 'GCD(35,7)');
- CheckEquals(41, GCD(41,41), 'GCD(41,41)');
- CheckEquals(24, GCD(144,120), 'GCD(144,120)');
- CheckEquals(2, GCD(10, 6), 'GCD(10, 6)');
- CheckEquals(2, GCD(-10, 6), 'GCD(-10, 6)');
- CheckEquals(1, GCD(-10, -9), 'GCD(-10, -9)');
- CheckEquals(5, GCD(-10, -5), 'GCD(-10, -5)');
- CheckEquals(41, GCD(-41, -41), 'GCD(-41, -41)');
- CheckEquals(10, GCD(10, -10), 'GCD(10, -10)');
-end;
-
-procedure TestMathsCatSnippets.TestGCD2;
-begin
- CheckEquals(1, GCD2(1,1), 'GCD2(1,1)');
- CheckEquals(6, GCD2(12,6), 'GCD2(12,6)');
- CheckEquals(1, GCD2(13,7), 'GCD2(13,7)');
- CheckEquals(7, GCD2(35,7), 'GCD2(35,7)');
- CheckEquals(41, GCD2(41,41), 'GCD2(41,41)');
- CheckEquals(24, GCD2(144,120), 'GCD2(144,120)');
- CheckEquals(2, GCD2(10, 6), 'GCD2(10, 6)');
- CheckEquals(2, GCD2(-10, 6), 'GCD2(-10, 6)');
- CheckEquals(1, GCD2(-10, -9), 'GCD2(-10, -9)');
- CheckEquals(5, GCD2(-10, -5), 'GCD2(-10, -5)');
- CheckEquals(41, GCD2(-41,-41), 'GCD2(-41,-41)');
- CheckEquals(10, GCD2(10, -10), 'GCD2(10, -10)');
-end;
-
-procedure TestMathsCatSnippets.TestIsPrime;
-var
- AllValues: array[1..542] of Boolean;
- I, PrimeIdx: Integer;
- Res: Boolean;
-begin
- for I := Low(AllValues) to High(AllValues) do
- AllValues[I] := False;
- for PrimeIdx := Low(First100Primes) to High(First100Primes) do
- AllValues[First100Primes[PrimeIdx]] := True;
- for I := Low(AllValues) to High(AllValues) do
- begin
- Res := IsPrime(I);
- CheckEquals(AllValues[I], Res, Format('IsPrime(%d)', [I]));
- end;
-end;
-
-procedure TestMathsCatSnippets.TestIsPrime2;
-var
- AllValues: array[1..542] of Boolean;
- I, PrimeIdx: Integer;
- Res: Boolean;
-begin
- for I := Low(AllValues) to High(AllValues) do
- AllValues[I] := False;
- for PrimeIdx := Low(First100Primes) to High(First100Primes) do
- AllValues[First100Primes[PrimeIdx]] := True;
- for I := Low(AllValues) to High(AllValues) do
- begin
- Res := IsPrime2(I);
- CheckEquals(AllValues[I], Res, Format('IsPrime2(%d)', [I]));
- end;
-end;
-
-procedure TestMathsCatSnippets.TestLCD;
-begin
- CheckEquals(26, LCD(2, 13), 'LCD(2, 13)');
- CheckEquals(36, LCD(12, 18), 'LCD(12, 18)');
- CheckEquals(36, LCD(-12, 18), 'LCD(-12, 18)');
- CheckEquals(36, LCD(12, -18), 'LCD(12, -18)');
- CheckEquals(36, LCD(-12, -18), 'LCD(-12, -18)');
- CheckEquals(9, LCD(1, 9), 'LCD(1, 9)');
- CheckEquals(208, LCD(16, 52), 'LCD(16, 52)');
- CheckEquals(208, LCD(52, 16), 'LCD(52, 16)');
- CheckEquals(12, LCD(12, 12), 'LCD(12, 12)');
- CheckEquals(60, LCD(12, 15), 'LCD(12, 15)');
- CheckEquals(36, LCD(18, 12), 'LCD(18, 12)');
- CheckEquals(30, LCD(15, 6), 'LCD(15, 6)');
- CheckEquals(30, LCD(15, 10), 'LCD(15, 10)');
- CheckEquals(9, LCD(-9, -9), 'LCD(-9, -9)');
-end;
-
-procedure TestMathsCatSnippets.TestMaxOfArray_Double;
-var
- A: TDoubleDynArray;
- N: Double;
-begin
- A := TDoubleDynArray.Create(3.0, 6.0, 42.3, 2.4, 8.876);
- N := 42.3;
- Check(SameValue(N, MaxOfArray(A)), 'Test 1');
- A := TDoubleDynArray.Create(42.12);
- N := 42.12;
- Check(SameValue(N, MaxOfArray(A)), 'Test 2');
- A := TDoubleDynArray.Create(-3.142, -6.284, -42.7, -8.789);
- N := -3.142;
- Check(SameValue(N, MaxOfArray(A)), 'Test 3');
- A := TDoubleDynArray.Create(6.0, 42.0, 42.0, 6.0);
- N := 42.0;
- Check(SameValue(N, MaxOfArray(A)), 'Test 4');
- A := TDoubleDynArray.Create(52.25, 6.6, 42.42, 8.8);
- N := 52.25;
- Check(SameValue(N, MaxOfArray(A)), 'Test 5');
-end;
-
-procedure TestMathsCatSnippets.TestMaxOfArray_Extended;
-type
- TExtendedDynArray = array of Extended;
-var
- A: TExtendedDynArray;
- N: Extended;
-begin
- A := TExtendedDynArray.Create(3.0, 6.0, 42.3, 2.4, 8.876);
- N := 42.3;
- Check(SameValue(N, MaxOfArray(A)), 'Test 1');
- A := TExtendedDynArray.Create(42.12);
- N := 42.12;
- Check(SameValue(N, MaxOfArray(A)), 'Test 2');
- A := TExtendedDynArray.Create(-3.142, -6.284, -42.7, -8.789);
- N := -3.142;
- Check(SameValue(N, MaxOfArray(A)), 'Test 3');
- A := TExtendedDynArray.Create(6.0, 42.0, 42.0, 6.0);
- N := 42.0;
- Check(SameValue(N, MaxOfArray(A)), 'Test 4');
- A := TExtendedDynArray.Create(52.25, 6.6, 42.42, 8.8);
- N := 52.25;
- Check(SameValue(N, MaxOfArray(A)), 'Test 5');
-end;
-
-procedure TestMathsCatSnippets.TestMaxOfArray_Int64;
-var
- A: TInt64DynArray;
-begin
- A := TInt64DynArray.Create(3, 6, 42, 2, 8);
- CheckEquals(42, MaxOfArray(A), 'Test 1');
- A := TInt64DynArray.Create(420);
- CheckEquals(420, MaxOfArray(A), 'Test 2');
- A := TInt64DynArray.Create(-3, -6, -2, -8);
- CheckEquals(-2, MaxOfArray(A), 'Test 3');
- A := TInt64DynArray.Create(6, 42, 42, 6);
- CheckEquals(42, MaxOfArray(A), 'Test 4');
- A := TInt64DynArray.Create(56, 6, 42, 8);
- CheckEquals(56, MaxOfArray(A), 'Test 5');
-end;
-
-procedure TestMathsCatSnippets.TestMaxOfArray_Integer;
-var
- A: TIntegerDynArray;
-begin
- A := TIntegerDynArray.Create(3, 6, 42, 2, 8);
- CheckEquals(42, MaxOfArray(A), 'Test 1');
- A := TIntegerDynArray.Create(420);
- CheckEquals(420, MaxOfArray(A), 'Test 2');
- A := TIntegerDynArray.Create(-3, -6, -2, -8);
- CheckEquals(-2, MaxOfArray(A), 'Test 3');
- A := TIntegerDynArray.Create(6, 42, 42, 6);
- CheckEquals(42, MaxOfArray(A), 'Test 4');
- A := TIntegerDynArray.Create(56, 6, 42, 8);
- CheckEquals(56, MaxOfArray(A), 'Test 5');
-end;
-
-procedure TestMathsCatSnippets.TestMaxOfArray_Single;
-var
- A: TSingleDynArray;
- N: Single;
-begin
- A := TSingleDynArray.Create(3.0, 6.0, 42.3, 2.4, 8.876);
- N := 42.3;
- Check(SameValue(N, MaxOfArray(A)), 'Test 1');
- A := TSingleDynArray.Create(42.12);
- N := 42.12;
- Check(SameValue(N, MaxOfArray(A)), 'Test 2');
- A := TSingleDynArray.Create(-3.142, -6.284, -42.7, -8.789);
- N := -3.142;
- Check(SameValue(N, MaxOfArray(A)), 'Test 3');
- A := TSingleDynArray.Create(6.0, 42.0, 42.0, 6.0);
- N := 42.0;
- Check(SameValue(N, MaxOfArray(A)), 'Test 4');
- A := TSingleDynArray.Create(52.25, 6.6, 42.42, 8.8);
- N := 52.25;
- Check(SameValue(N, MaxOfArray(A)), 'Test 5');
-end;
-
-procedure TestMathsCatSnippets.TestMid_Double;
-var
- A, B, C, D, E: Double;
-begin
- A := 0.0; B := MaxDouble; C := -MaxDouble; D := 42.5623143; E := -42.5623152;
- Check(SameValue(A, Mid(A, B, C)), 'Mid(A, B, C)');
- Check(SameValue(A, Mid(B, A, C)), 'Mid(B, A, C)');
- Check(SameValue(A, Mid(A, C, B)), 'Mid(A, C, B)');
- Check(SameValue(A, Mid(B, C, A)), 'Mid(B, C, A)');
- Check(SameValue(D, Mid(A, B, D)), 'Mid(A, B, D)');
- Check(SameValue(E, Mid(A, C, E)), 'Mid(A, C, E)');
- Check(SameValue(D, Mid(D, D, D)), 'Mid(D, D, D)');
- Check(SameValue(D, Mid(D, D, E)), 'Mid(D, D, E)');
- Check(SameValue(D, Mid(D, E, D)), 'Mid(D, E, D)');
- Check(SameValue(D, Mid(E, D, D)), 'Mid(E, D, D)');
- Check(SameValue(E, Mid(D, E, E)), 'Mid(D, E, E)');
- Check(SameValue(E, Mid(E, D, E)), 'Mid(E, D, E)');
- Check(SameValue(E, Mid(E, E, D)), 'Mid(E, E, D)');
-end;
-
-procedure TestMathsCatSnippets.TestMid_Extended;
-var
- A, B, C, D, E: Extended;
-begin
- A := 0.0; B := MaxExtended; C := -MaxExtended; D := 42.56231; E := -42.56231;
- Check(SameValue(A, Mid(A, B, C)), 'Mid(A, B, C)');
- Check(SameValue(A, Mid(B, A, C)), 'Mid(B, A, C)');
- Check(SameValue(A, Mid(A, C, B)), 'Mid(A, C, B)');
- Check(SameValue(A, Mid(B, C, A)), 'Mid(B, C, A)');
- Check(SameValue(D, Mid(A, B, D)), 'Mid(A, B, D)');
- Check(SameValue(E, Mid(A, C, E)), 'Mid(A, C, E)');
- Check(SameValue(D, Mid(D, D, D)), 'Mid(D, D, D)');
- Check(SameValue(D, Mid(D, D, E)), 'Mid(D, D, E)');
- Check(SameValue(D, Mid(D, E, D)), 'Mid(D, E, D)');
- Check(SameValue(D, Mid(E, D, D)), 'Mid(E, D, D)');
- Check(SameValue(E, Mid(D, E, E)), 'Mid(D, E, E)');
- Check(SameValue(E, Mid(E, D, E)), 'Mid(E, D, E)');
- Check(SameValue(E, Mid(E, E, D)), 'Mid(E, E, D)');
-end;
-
-procedure TestMathsCatSnippets.TestMid_Int64;
-var
- A, B, C, D, E: Int64;
-begin
- A := 0; B := High(Int64); C := Low(Int64); D := 42; E := -42;
- CheckEquals(A, Mid(A, B, C), 'Mid(A, B, C)');
- CheckEquals(A, Mid(B, A, C), 'Mid(B, A, C)');
- CheckEquals(A, Mid(A, C, B), 'Mid(A, C, B)');
- CheckEquals(A, Mid(B, C, A), 'Mid(B, C, A)');
- CheckEquals(D, Mid(A, B, D), 'Mid(A, B, D)');
- CheckEquals(E, Mid(A, C, E), 'Mid(A, C, E)');
- CheckEquals(D, Mid(D, D, D), 'Mid(D, D, D)');
- CheckEquals(D, Mid(D, D, E), 'Mid(D, D, E)');
- CheckEquals(D, Mid(D, E, D), 'Mid(D, E, D)');
- CheckEquals(D, Mid(E, D, D), 'Mid(E, D, D)');
- CheckEquals(E, Mid(D, E, E), 'Mid(D, E, E)');
- CheckEquals(E, Mid(E, D, E), 'Mid(E, D, E)');
- CheckEquals(E, Mid(E, E, D), 'Mid(E, E, D)');
-end;
-
-procedure TestMathsCatSnippets.TestMid_Integer;
-var
- A, B, C, D, E: Integer;
-begin
- A := 0; B := High(Integer); C := Low(Integer); D := 42; E := -42;
- CheckEquals(A, Mid(A, B, C), 'Mid(A, B, C)');
- CheckEquals(A, Mid(B, A, C), 'Mid(B, A, C)');
- CheckEquals(A, Mid(A, C, B), 'Mid(A, C, B)');
- CheckEquals(A, Mid(B, C, A), 'Mid(B, C, A)');
- CheckEquals(D, Mid(A, B, D), 'Mid(A, B, D)');
- CheckEquals(E, Mid(A, C, E), 'Mid(A, C, E)');
- CheckEquals(D, Mid(D, D, D), 'Mid(D, D, D)');
- CheckEquals(D, Mid(D, D, E), 'Mid(D, D, E)');
- CheckEquals(D, Mid(D, E, D), 'Mid(D, E, D)');
- CheckEquals(D, Mid(E, D, D), 'Mid(E, D, D)');
- CheckEquals(E, Mid(D, E, E), 'Mid(D, E, E)');
- CheckEquals(E, Mid(E, D, E), 'Mid(E, D, E)');
- CheckEquals(E, Mid(E, E, D), 'Mid(E, E, D)');
-end;
-
-procedure TestMathsCatSnippets.TestMid_Single;
-var
- A, B, C, D, E: Single;
-begin
- A := 0.0; B := MaxSingle; C := -MaxSingle; D := 42.56231; E := -42.56231;
- Check(SameValue(A, Mid(A, B, C)), 'Mid(A, B, C)');
- Check(SameValue(A, Mid(B, A, C)), 'Mid(B, A, C)');
- Check(SameValue(A, Mid(A, C, B)), 'Mid(A, C, B)');
- Check(SameValue(A, Mid(B, C, A)), 'Mid(B, C, A)');
- Check(SameValue(D, Mid(A, B, D)), 'Mid(A, B, D)');
- Check(SameValue(E, Mid(A, C, E)), 'Mid(A, C, E)');
- Check(SameValue(D, Mid(D, D, D)), 'Mid(D, D, D)');
- Check(SameValue(D, Mid(D, D, E)), 'Mid(D, D, E)');
- Check(SameValue(D, Mid(D, E, D)), 'Mid(D, E, D)');
- Check(SameValue(D, Mid(E, D, D)), 'Mid(E, D, D)');
- Check(SameValue(E, Mid(D, E, E)), 'Mid(D, E, E)');
- Check(SameValue(E, Mid(E, D, E)), 'Mid(E, D, E)');
- Check(SameValue(E, Mid(E, E, D)), 'Mid(E, E, D)');
-end;
-
-procedure TestMathsCatSnippets.TestMinOfArray_Double;
-var
- A: TDoubleDynArray;
- N: Double;
-begin
- A := TDoubleDynArray.Create(3.0, 6.0, 42.3, 2.4, 8.876);
- N := 2.4;
- Check(SameValue(N, MinOfArray(A)), 'Test 1');
- A := TDoubleDynArray.Create(42.12);
- N := 42.12;
- Check(SameValue(N, MinOfArray(A)), 'Test 2');
- A := TDoubleDynArray.Create(3.142, 6.284, 42.7, 2.2, -8.789);
- N := -8.789;
- Check(SameValue(N, MinOfArray(A)), 'Test 3');
- A := TDoubleDynArray.Create(6.0, 42.0, 42.0, 6.0);
- N := 6.0;
- Check(SameValue(N, MinOfArray(A)), 'Test 4');
- A := TDoubleDynArray.Create(2.2, 6.6, 42.42, 8.8);
- N := 2.2;
- Check(SameValue(N, MinOfArray(A)), 'Test 5');
-end;
-
-procedure TestMathsCatSnippets.TestMinOfArray_Extended;
-type
- TExtendedDynArray = array of Extended;
-var
- A: TExtendedDynArray;
- N: Extended;
-begin
- A := TExtendedDynArray.Create(3.0, 6.0, 42.3, 2.4, 8.876);
- N := 2.4;
- Check(SameValue(N, MinOfArray(A)), 'Test 1');
- A := TExtendedDynArray.Create(42.12);
- N := 42.12;
- Check(SameValue(N, MinOfArray(A)), 'Test 2');
- A := TExtendedDynArray.Create(3.142, 6.284, 42.7, 2.2, -8.789);
- N := -8.789;
- Check(SameValue(N, MinOfArray(A)), 'Test 3');
- A := TExtendedDynArray.Create(6.0, 42.0, 42.0, 6.0);
- N := 6.0;
- Check(SameValue(N, MinOfArray(A)), 'Test 4');
- A := TExtendedDynArray.Create(2.2, 6.6, 42.42, 8.8);
- N := 2.2;
- Check(SameValue(N, MinOfArray(A)), 'Test 5');
-end;
-
-procedure TestMathsCatSnippets.TestMinOfArray_Int64;
-var
- A: TInt64DynArray;
-begin
- A := TInt64DynArray.Create(3, 6, 42, 2, 8);
- CheckEquals(2, MinOfArray(A), 'Test 1');
- A := TInt64DynArray.Create(42);
- CheckEquals(42, MinOfArray(A), 'Test 2');
- A := TInt64DynArray.Create(3, 6, 42, 2, -8);
- CheckEquals(-8, MinOfArray(A), 'Test 3');
- A := TInt64DynArray.Create(6, 42, 42, 6);
- CheckEquals(6, MinOfArray(A), 'Test 4');
- A := TInt64DynArray.Create(2, 6, 42, 8);
- CheckEquals(2, MinOfArray(A), 'Test 5');
-end;
-
-procedure TestMathsCatSnippets.TestMinOfArray_Integer;
-var
- A: TIntegerDynArray;
-begin
- A := TIntegerDynArray.Create(3, 6, 42, 2, 8);
- CheckEquals(2, MinOfArray(A), 'Test 1');
- A := TIntegerDynArray.Create(42);
- CheckEquals(42, MinOfArray(A), 'Test 2');
- A := TIntegerDynArray.Create(3, 6, 42, 2, -8);
- CheckEquals(-8, MinOfArray(A), 'Test 3');
- A := TIntegerDynArray.Create(6, 42, 42, 6);
- CheckEquals(6, MinOfArray(A), 'Test 4');
- A := TIntegerDynArray.Create(2, 6, 42, 8);
- CheckEquals(2, MinOfArray(A), 'Test 5');
-end;
-
-procedure TestMathsCatSnippets.TestMinOfArray_Single;
-var
- A: TSingleDynArray;
- N: Single;
-begin
- A := TSingleDynArray.Create(3.0, 6.0, 42.3, 2.4, 8.876);
- N := 2.4;
- Check(SameValue(N, MinOfArray(A)), 'Test 1');
- A := TSingleDynArray.Create(42.12);
- N := 42.12;
- Check(SameValue(N, MinOfArray(A)), 'Test 2');
- A := TSingleDynArray.Create(3.142, 6.284, 42.7, 2.2, -8.789);
- N := -8.789;
- Check(SameValue(N, MinOfArray(A)), 'Test 3');
- A := TSingleDynArray.Create(6.0, 42.0, 42.0, 6.0);
- N := 6.0;
- Check(SameValue(N, MinOfArray(A)), 'Test 4');
- A := TSingleDynArray.Create(2.2, 6.6, 42.42, 8.8);
- N := 2.2;
- Check(SameValue(N, MinOfArray(A)), 'Test 5');
-end;
-
-procedure TestMathsCatSnippets.TestResizeRect_A;
-var
- R: Types.TRect;
- S: Types.TSize;
-begin
- R := Rect(12, 24, 36, 48);
- S.cx := 20; S.cy := 30;
- R := ResizeRect(R, S);
- CheckEquals(12, R.Left, '1: R.Left');
- CheckEquals(12 + 20, R.Right, '1: R.Right');
- CheckEquals(20, RectWidth(R), '1: RectWidth');
- CheckEquals(24, R.Top, '1: R.Top');
- CheckEquals(24 + 30, R.Bottom, '1: R.Bottom');
- CheckEquals(30, RectHeight(R), '1: RectHeight');
- R := Rect(12, 24, 36, 48);
- S.cx := 0;
- S.cy := 0;
- R := ResizeRect(R, S);
- CheckEquals(12, R.Left, '2: R.Left');
- CheckEquals(12 + 0, R.Right, '2: R.Right');
- CheckEquals(0, RectWidth(R), '2: RectWidth');
- CheckEquals(24, R.Top, '2: R.Top');
- CheckEquals(24 + 0, R.Bottom, '2: R.Bottom');
- CheckEquals(0, RectHeight(R), '2: RectHeight');
- R := Rect(12, 24, 36, 48);
- S.cx := -3;
- S.cy := -4;
- R := ResizeRect(R, S);
- CheckEquals(12, R.Left, '3: R.Left');
- CheckEquals(12 - 3, R.Right, '3: R.Right');
- CheckEquals(-3, RectWidth(R), '3: RectWidth');
- CheckEquals(24, R.Top, '3: R.Top');
- CheckEquals(24 - 4, R.Bottom, '3: R.Bottom');
- CheckEquals(-4, RectHeight(R), '3: RectHeight');
-end;
-
-procedure TestMathsCatSnippets.TestResizeRect_B;
-var
- R: Types.TRect;
- W, H: Integer;
-begin
- R := Rect(12, 24, 36, 48);
- W := 20; H := 30;
- R := ResizeRect(R, W, H);
- CheckEquals(12, R.Left, '1: R.Left');
- CheckEquals(12 + 20, R.Right, '1: R.Right');
- CheckEquals(20, RectWidth(R), '1: RectWidth');
- CheckEquals(24, R.Top, '1: R.Top');
- CheckEquals(24 + 30, R.Bottom, '1: R.Bottom');
- CheckEquals(30, RectHeight(R), '1: RectHeight');
- R := Rect(12, 24, 36, 48);
- W := 0;
- H := 0;
- R := ResizeRect(R, W, H);
- CheckEquals(12, R.Left, '2: R.Left');
- CheckEquals(12 + 0, R.Right, '2: R.Right');
- CheckEquals(0, RectWidth(R), '2: RectWidth');
- CheckEquals(24, R.Top, '2: R.Top');
- CheckEquals(24 + 0, R.Bottom, '2: R.Bottom');
- CheckEquals(0, RectHeight(R), '2: RectHeight');
- R := Rect(12, 24, 36, 48);
- W := -3;
- H := -4;
- R := ResizeRect(R, W, H);
- CheckEquals(12, R.Left, '3: R.Left');
- CheckEquals(12 - 3, R.Right, '3: R.Right');
- CheckEquals(-3, RectWidth(R), '3: RectWidth');
- CheckEquals(24, R.Top, '3: R.Top');
- CheckEquals(24 - 4, R.Bottom, '3: R.Bottom');
- CheckEquals(-4, RectHeight(R), '3: RectHeight');
-end;
-
-procedure TestMathsCatSnippets.TestStretchRect_A;
-var
- R0, R1, R2: TRect;
-begin
- R0 := Rect(10, 40, 50, 100);
- R1 := StretchRect(R0, 1.5, 0.5);
- CheckEquals(10, R1.Left, 'R1.Left');
- CheckEquals(70, R1.Right, 'R1.Right');
- CheckEquals(40, R1.Top, 'R1.Top');
- CheckEquals(70, R1.Bottom, '1: R1.Bottom');
- R2 := StretchRect(R0, -1.5, -0.5);
- CheckEquals(10, R2.Left, 'R2.Left');
- CheckEquals(-50, R2.Right, '2: R2.Right');
- CheckEquals(40, R2.Top, 'R2.Top');
- CheckEquals(10, R2.Bottom, '2: R2.Bottom');
- CheckException(StretchRect_A_Except1, EOverflow, 'Large X scaling');
- CheckException(StretchRect_A_Except2, EOverflow, 'Large Y scaling');
-end;
-
-procedure TestMathsCatSnippets.TestStretchRect_B;
-var
- R0, R1, R2: TRect;
-begin
- R0 := Rect(10, 40, 50, 100);
- R1 := StretchRect(R0, 0.5);
- CheckEquals(10, R1.Left, 'R1.Left');
- CheckEquals(30, R1.Right, '1: R1.Right');
- CheckEquals(40, R1.Top, 'R1.Top');
- CheckEquals(70, R1.Bottom, '1: R1.Bottom');
- R2 := StretchRect(R0, -0.5);
- CheckEquals(10, R2.Left, 'R2.Left');
- CheckEquals(-10, R2.Right, '2: R2.Right');
- CheckEquals(40, R2.Top, 'R2.Top');
- CheckEquals(10, R2.Bottom, '2: R2.Bottom');
- CheckException(StretchRect_B_Except, EOverflow, 'Large scaling');
-end;
-
-initialization
- // Register any test cases with the test runner
- RegisterTest(TestMathsCatSnippets.Suite);
-
-end.
diff --git a/csdb/tests/Cat-Maths/UMathsCatSnippets.pas b/csdb/tests/Cat-Maths/UMathsCatSnippets.pas
deleted file mode 100644
index 6a10541..0000000
--- a/csdb/tests/Cat-Maths/UMathsCatSnippets.pas
+++ /dev/null
@@ -1,1287 +0,0 @@
-{
- * This file was generated from the DelphiDabbler Code Snippets Database.
- * The source code is licensed under the MIT license, copyright © 2005-2021,
- * Peter Johnson (https://gravatar.com/delphidabbler) and Contributors. The
- * full license and a list of contributors can be found in the `LICENSE` and
- * `CONTRIBUTORS` files at
- * https://github.com/delphidabbler/code-snippets/tree/master/csdb/collection
-}
-
-unit UMathsCatSnippets;
-
-interface
-
-uses
- SysUtils, Math, Types, Windows;
-
-type
- {Encapsulates a point with double precision floating point coordinates.}
- TPointF = record
- X, Y: Double; // x and y coordinates
- end;
-
-type
- {Encapsulates a rectangle with double precision floating point size and
- position.}
- TRectF = record
- case Integer of
- 0: (Left, Top, Right, Bottom: Double);
- 1: (TopLeft, BottomRight: TPointF);
- end;
-
-type
- {Record that represents the size, i.e. the width and height, of something.
- This is an extended version of the TSize record that features equality and
- inequality operator overloading, a test for zero size and a constructor.
- TSizeEx is assignment compatible and comparible with the Delphi RTL's TSize
- record.}
- TSizeEx = record
- public
- // Width
- CX: Integer;
- // Height
- CY: Integer;
- // Constructs record with two given CX and CY field values
- constructor Create(ACX, ACY: Integer);
- // Enables TSize to be assigned to and compared with TSizeEx
- class operator Implicit(S: Types.TSize): TSizeEx;
- // Enables TSizeEx to be assigned to and compared with TSize
- class operator Implicit(S: TSizeEx): Types.TSize;
- // Tests for equality of TSizeEx records. Also works if one record is TSize.
- class operator Equal(S1, S2: TSizeEx): Boolean;
- // Tests for inequality of TSizeEx records. Also works if one record is
- // TSize.
- class operator NotEqual(S1, S2: TSizeEx): Boolean;
- // Tests if a TSizeEx instance is zero (i.e. one of fields is zero)
- function IsZero: Boolean;
- end;
-
-function AllDigitsDifferent(N: Int64): Boolean;
- {Checks if all the digits of the given integer are different to each other.}
-
-function AllDigitsSame(N: Int64): Boolean;
- {Checks if all the digits of the given integer are the same.}
-
-function BoundsF(ALeft, ATop, AWidth, AHeight: Double): TRectF;
- {Constructs and returns a TRectF record with the given top-left coordinate,
- width and height.}
-
-procedure DecimalToFraction(Decimal: Extended; out FractionNumerator: Extended;
- out FractionDenominator: Extended; const AccuracyFactor: Extended);
- {Converts the given decimal to a fraction. The numerator and denominator are
- passed out as floating point numbers in FractionNumerator and
- FractionDenominator respectively.
- AccuracyFactor determines how accurate the conversion is to be.}
-
-function DigitCount(AInteger: Int64): Integer;
- {Counts the number of digits in the given integer.}
-
-function DigitCount2(const AValue: Int64): Integer;
- {Counts the number of digits in the given integer.}
-
-function DigitCountR(AValue: Int64): Integer;
- {Counts the number of digits in the given integer using recursion.}
-
-function DigitSum(AValue: Int64): Integer;
- {Returns the sum of the digits from the given integer, using recursion.}
-
-function DistanceBetweenPoints(const P1, P2: TPointF): Extended; overload;
- {Calculates the distance between two given points with double precision
- floating point valued coordinates.}
-
-function DistanceBetweenPoints(const P1, P2: Types.TPoint): Extended; overload;
- {Calculates the distance between two points with integer valued co-ordinates.}
-
-function Factorial(N: Byte): Int64;
- {Calculates the factorial of the given number.}
-
-function GCD(A, B: Integer): Integer;
- {Determines the greatest common divisor of two given integers.}
-
-function GCD2(const A, B: Integer): Integer;
- {Determines the greatest common divisor of two given integers.}
-
-function IsPrime(N: Integer): Boolean;
- {Checks if the given number is prime.}
-
-function IsPrime2(Val: Integer): Boolean;
- {Checks if the given number is prime.}
-
-function IsRectNormal(const R: Windows.TRect): Boolean;
- {Checks if the given rectangle is normalized, i.e. Left <= Right and Top <=
- Bottom.}
-
-function LCD(A, B: Integer): Integer;
- {Returns the least common divisor of two given integers.}
-
-function MaxOfArray(const A: array of Double): Double; overload;
- {Returns the maximum value contained in the given array of double precision
- floating point values.
- The array must not be empty.}
-
-function MaxOfArray(const A: array of Extended): Extended; overload;
- {Returns the maximum value contained in the given array of extended precision
- floating point values.
- The array must not be empty.}
-
-function MaxOfArray(const A: array of Int64): Int64; overload;
- {Returns the maximum value contained in the given array of 64 bit integer
- values.
- The array must not be empty.}
-
-function MaxOfArray(const A: array of Integer): Integer; overload;
- {Returns the maximum value contained in the given array of integer values.
- The array must not be empty.}
-
-function MaxOfArray(const A: array of Single): Single; overload;
- {Returns the maximum value contained in the given array of single precision
- floating point values.
- The array must not be empty.}
-
-function Mid(const A, B, C: Double): Double; overload;
- {Returns the middle of three double precision floating point values.}
-
-function Mid(const A, B, C: Extended): Extended; overload;
- {Returns the middle of three extended precision floating point values.}
-
-function Mid(const A, B, C: Int64): Int64; overload;
- {Returns the middle of three 64 bit integer values.}
-
-function Mid(const A, B, C: Integer): Integer; overload;
- {Returns the middle of three integer values.}
-
-function Mid(const A, B, C: Single): Single; overload;
- {Returns the middle of three single precision floating point values.}
-
-procedure MinMidMax(const A, B, C: Double; out Min, Mid, Max: Double); overload;
- {Finds the minimum, middle and maximum values of three double precision
- floating point numbers, A, B and C and returns them in Min, Mid and Max
- respectively.}
-
-procedure MinMidMax(const A, B, C: Extended; out Min, Mid, Max: Extended);
- overload;
- {Finds the minimum, middle and maximum values of three extended precision
- floating point numbers, A, B and C and returns them in Min, Mid and Max
- respectively.}
-
-procedure MinMidMax(const A, B, C: Int64; out Min, Mid, Max: Int64); overload;
- {Finds the minimum, middle and maximum values of three 64 bit integers, A, B
- and C and returns them in Min, Mid and Max respectively.}
-
-procedure MinMidMax(const A, B, C: Integer; out Min, Mid, Max: Integer);
- overload;
- {Finds the minimum, middle and maximum values of three integers, A, B and C
- and returns them in Min, Mid and Max respectively.}
-
-procedure MinMidMax(const A, B, C: Single; out Min, Mid, Max: Single); overload;
- {Finds the minimum, middle and maximum values of three single precision
- floating point numbers, A, B and C and returns them in Min, Mid and Max
- respectively.}
-
-function MinOfArray(const A: array of Double): Double; overload;
- {Returns the minimum value contained in the given array of double precision
- floating point values.
- The array must not be empty.}
-
-function MinOfArray(const A: array of Extended): Extended; overload;
- {Returns the minimum value contained in the given array of extended precision
- floating point values.
- The array must not be empty.}
-
-function MinOfArray(const A: array of Int64): Int64; overload;
- {Returns the minimum value contained in the given array of 64 bit integer
- values.
- The array must not be empty.}
-
-function MinOfArray(const A: array of Integer): Integer; overload;
- {Returns the minimum value contained in the given array of integer values.
- The array must not be empty.}
-
-function MinOfArray(const A: array of Single): Single; overload;
- {Returns the minimum value contained in the given array of single precision
- floating point values.
- The array must not be empty.}
-
-function MoveRectToOrigin(const R: Types.TRect): Types.TRect;
- {Translates the give rectangle to the origin.
- The top and left co-ordinates are set to zero and the bottom and right
- co-ordinates are adjusted accordingly.}
-
-procedure NormaliseFractionSign(var Num, Denom: Integer);
- {Normalises the sign of the fraction with numerator Num and denominator Denom
- so that Num takes the sign of the fraction and Denom is non-negative.}
-
-function NormalizeRect(const R: Windows.TRect): Windows.TRect;
- {Normalises the given rectangle so that Left <= Right and Top <= Bottom.}
-
-function PointF(const AX, AY: Double): TPointF;
- {Constructs and returns a TPointF record with the given x & y coordinates.}
-
-function Pow(const Base: Int64; const Exponent: Byte): Int64;
- {Raises integer value Base to non-negative integer power Exponent and returns
- the result.}
-
-function RectArea(const R: Windows.TRect): Int64;
- {Returns the area of the given rectangle.}
-
-function RectF(const ALeft, ATop, ARight, ABottom: Double): TRectF;
- {Constructs and returns a TRectF record with the given left, top, right &
- bottom coordinates.}
-
-function RectHeight(const R: Windows.TRect): Integer;
- {Returns the height of the given rectangle.
- The return value is always non-negative even if the rectangle is not
- normalized.}
-
-function RectSize(const R: Windows.TRect): Windows.TSize;
- {Returns the size of the given rectangle.
- The returned dimensions are always non-negative even if the rectangle is not
- normalized.}
-
-function RectWidth(const R: Windows.TRect): Integer;
- {Returns the width of the given rectangle.
- The return value is always non-negative even if the rectangle is not
- normalized.}
-
-function RepeatedDigits(N: Int64): Boolean;
- {Checks if the given integer contains only a single repeated digit.}
-
-function ResizeRect(const R: Types.TRect; const NewSize: Types.TSize):
- Types.TRect; overload;
- {Resizes rectangle R to size NewSize, leaving the top-left position unchanged.
- Returns the resized rectangle.}
-
-function ResizeRect(const R: Types.TRect; const NewWidth, NewHeight: LongInt):
- Types.TRect; overload;
- {Resizes rectangle R to the width and height given by NewWidth and NewHeight,
- leaving the top-left position unchanged.
- Returns the resized rectangle.}
-
-function ReverseNumber(AValue: Int64): Int64;
- {Reverses the digits of the given integer and returns the resulting value.
- The given integer should be greater than zero: the function always returns
- zero for negative integers.}
-
-function ReverseNumberR(AValue: Int64): Int64;
- {Reverses the digits of the given integer, which must be non-negative, and
- returns the resulting value.
- Uses recursion.}
-
-function SAR(Value: LongInt; Shift: Byte): LongInt;
- {Performs an arithmetic right shift operation on the given value and returns
- the result. Value is shifted right by Shift bits.
- Shift must be in the range 0..31 and is adjusted if it is not.}
-
-function ScaleRect(const ARect: Types.TRect; AScaling: Double): Types.TRect;
- {Scales the given rectangle by the given scale factor and returns the scaled
- rectangle.}
-
-function SignOfFloat(const Value: Extended): Integer;
- {Returns the sign of the given floating point value. Returns -1 if the value
- is positive, 0 if zero or +1 if negative.}
-
-function SignOfInt(const Value: Int64): Integer;
- {Returns the sign of the given integer. Returns -1 if the integer is positive,
- 0 if zero or +1 if negative.}
-
-function Size(const ACX, ACY: Integer): Types.TSize;
- {Constructs and returns a TSize record with the given dimensions.}
-
-function StretchRect(const R: Types.TRect; const ScalingX, ScalingY: Double):
- Types.TRect; overload;
- {Stretches rectangle R by the given scaling factors and returns the result.
- The rectangle's width is scaled by ScalingX and its height by ScalingY.
- The top left corner of the rectangle is not changed.}
-
-function StretchRect(const R: Types.TRect; const Scaling: Double):
- Types.TRect; overload;
- {Stretches the rectangle R by scale factor Scaling and returns the result.
- Both width and height are stretched by the same scale factor.
- The top left corner is not changed.}
-
-function ZoomRatio(const DestWidth, DestHeight, SrcWidth, SrcHeight: Integer):
- Double; overload;
- {Calculates and returns the largest scaling that can be applied to a rectangle
- of width SrcWidth and height SrcHeight to fit it, without changing the aspect
- ratio, within a second rectangle of width DestWidth and height DestHeight.}
-
-function ZoomRatio(const DestSize, SrcSize: Types.TSize): Double; overload;
- {Calculates and returns the largest scaling that can be applied to a rectangle
- of size SrcSize to fit it, without changing the aspect ratio, within a second
- rectangle of size DestSize.}
-
-function ZoomRatio(const DestRect, SrcRect: Types.TRect): Double; overload;
- {Calculates and returns the largest scaling that can be applied to rectangle
- SrcRect to fit it, without changing the aspect ratio, within rectangle
- DestRect.}
-
-implementation
-
-procedure ExchangeInt(var I1, I2: Integer);
- forward;
-
-function AllDigitsDifferent(N: Int64): Boolean;
- {Checks if all the digits of the given integer are different to each other.}
-var
- UsedDigits: array[0..9] of Boolean; // records which digits have been used
- I: 0..9; // loops through elements of UsedDigits
- M: 0..9; // modulus after dividing by 10
-begin
- N := Abs(N);
- Result := False;
- for I := 0 to 9 do
- UsedDigits[I] := False;
- while N > 0 do
- begin
- M := N mod 10;
- if UsedDigits[M] then
- Exit;
- UsedDigits[M] := True;
- N := N div 10;
- end;
- Result := True; // if we get here all digits are unique
-end;
-
-function AllDigitsSame(N: Int64): Boolean;
- {Checks if all the digits of the given integer are the same.}
-var
- D: 0..9; // sample digit from N
-begin
- N := Abs(N);
- D := N mod 10;
- Result := False;
- while N > 0 do
- begin
- if N mod 10 <> D then
- Exit;
- N := N div 10;
- end;
- Result := True;
-end;
-
-function BoundsF(ALeft, ATop, AWidth, AHeight: Double): TRectF;
- {Constructs and returns a TRectF record with the given top-left coordinate,
- width and height.}
-begin
- Result.Left := ALeft;
- Result.Top := ATop;
- Result.Right := ALeft + AWidth;
- Result.Bottom := ATop + AHeight;
-end;
-
-procedure DecimalToFraction(Decimal: Extended; out FractionNumerator: Extended;
- out FractionDenominator: Extended; const AccuracyFactor: Extended);
- {Converts the given decimal to a fraction. The numerator and denominator are
- passed out as floating point numbers in FractionNumerator and
- FractionDenominator respectively.
- AccuracyFactor determines how accurate the conversion is to be.}
-var
- DecimalSign: Extended;
- Z: Extended;
- PreviousDenominator: Extended;
- ScratchValue: Extended;
-{$IFDEF FPC}
-const
-{$ELSE}
-resourcestring
-{$ENDIF}
- sTooSmall = 'Decimal too small to convert to fraction';
- sTooLarge = 'Decimal too large to convert to fraction';
-const
- LargestDecimal: Extended = 1.0E+19;
- SmallestDecimal: Extended = 1.0E-19;
-begin
- if Decimal < 0.0 then
- DecimalSign := -1.0
- else
- DecimalSign := 1.0;
- Decimal := Abs(Decimal);
- if Math.SameValue(Decimal, Int(Decimal)) then
- begin
- FractionNumerator := Decimal * DecimalSign;
- FractionDenominator := 1.0;
- Exit;
- end;
- if (Decimal < SmallestDecimal) then // X = 0 already taken care of
- raise SysUtils.EConvertError.Create(sTooSmall);
- if (Decimal > LargestDecimal) then
- raise SysUtils.EConvertError.Create(sTooLarge);
- Z := Decimal;
- PreviousDenominator := 0.0;
- FractionDenominator := 1.0;
- repeat
- Z := 1.0 / (Z - Int(Z));
- ScratchValue := FractionDenominator;
- FractionDenominator := FractionDenominator * Int(Z) + PreviousDenominator;
- PreviousDenominator := ScratchValue;
- FractionNumerator := Int(Decimal * FractionDenominator + 0.5) // Rounding
- until
- (
- Abs(
- Decimal - (FractionNumerator / FractionDenominator)
- ) < AccuracyFactor
- )
- or (Z = Int(Z));
- FractionNumerator := DecimalSign * FractionNumerator;
-end;
-
-function DigitCount(AInteger: Int64): Integer;
- {Counts the number of digits in the given integer.}
-begin
- if AInteger <> 0 then
- begin
- Result := 0;
- AInteger := Abs(AInteger);
- while AInteger > 0 do
- begin
- AInteger := AInteger div 10;
- Inc(Result);
- end;
- end
- else
- Result := 1;
-end;
-
-function DigitCount2(const AValue: Int64): Integer;
- {Counts the number of digits in the given integer.}
-begin
- if AValue <> 0 then
- Result := Math.Floor(Math.Log10(Abs(AValue))) + 1
- else
- Result := 1;
-end;
-
-function DigitCountR(AValue: Int64): Integer;
- {Counts the number of digits in the given integer using recursion.}
-begin
- if AValue mod 10 = AValue then
- Result := 1
- else
- Result := 1 + DigitCountR(AValue div 10)
-end;
-
-function DigitSum(AValue: Int64): Integer;
- {Returns the sum of the digits from the given integer, using recursion.}
-begin
- if AValue mod 10 = AValue then
- Result := AValue
- else
- Result := (AValue mod 10) + DigitSum(AValue div 10)
-end;
-
-function DistanceBetweenPoints(const P1, P2: TPointF): Extended; overload;
- {Calculates the distance between two given points with double precision
- floating point valued coordinates.}
-begin
- Result := Math.Hypot(P1.X - P2.X, P1.Y - P2.Y);
-end;
-
-function DistanceBetweenPoints(const P1, P2: Types.TPoint): Extended; overload;
- {Calculates the distance between two points with integer valued co-ordinates.}
-begin
- Result := Math.Hypot(P1.X - P2.X, P1.Y - P2.Y);
-end;
-
-procedure ExchangeInt(var I1, I2: Integer);
- {Exchanges the values of two given integers.}
-var
- Temp: Integer; // temporary value used when exchanging values
-begin
- Temp := I1;
- I1 := I2;
- I2 := Temp;
-end;
-
-function Factorial(N: Byte): Int64;
- {Calculates the factorial of the given number.}
-var
- K: Integer; // loop control
-begin
- Result := 1;
- if (N = 0) or (N = 1) then
- Exit;
- for K := 2 to N do
- Result := Result * K;
-end;
-
-function GCD(A, B: Integer): Integer;
- {Determines the greatest common divisor of two given integers.}
-var
- Temp: Integer; // used in swapping A & B
-begin
- while B <> 0 do
- begin
- Temp := B;
- B := A mod Temp;
- A := Temp;
- end;
- Result := Abs(A);
-end;
-
-function GCD2(const A, B: Integer): Integer;
- {Determines the greatest common divisor of two given integers.}
-begin
- if B = 0 then
- Result := Abs(A)
- else
- Result := GCD2(B, A mod B);
-end;
-
-function IsPrime(N: Integer): Boolean;
- {Checks if the given number is prime.}
-var
- Max: Integer; // max divisor
- Divisor: Integer; // different divisors to try
-begin
- Result := False;
- if N < 2 then
- Exit; // not a prime
- Result := True;
- if N = 2 then
- Exit; // 2 is prime
- if N mod 2 = 0 then
- Result := False; // even numbers > 2 are not prime
- Max := Trunc(Sqrt(N)) + 1;
- Divisor := 3;
- // test odd numbers
- while (Max > Divisor) and Result do
- begin
- if (N mod Divisor) = 0 then
- Result := False;
- Inc(Divisor, 2); // next odd number
- end;
-end;
-
-function IsPrime2(Val: Integer): Boolean;
- {Checks if the given number is prime.}
-var
- X: Integer; // index
-begin
- Result := (Val > 1);
- if Result then
- begin
- for X := (Val div 2) downto 2 do
- begin
- Result := Result and ((Val mod X) <> 0);
- if not Result then
- Break;
- end;
- end;
-end;
-
-function IsRectNormal(const R: Windows.TRect): Boolean;
- {Checks if the given rectangle is normalized, i.e. Left <= Right and Top <=
- Bottom.}
-begin
- Result := (R.Left <= R.Right) and (R.Top <= R.Bottom);
-end;
-
-function LCD(A, B: Integer): Integer;
- {Returns the least common divisor of two given integers.}
-begin
- Result := Abs((A * B)) div GCD(A, B);
-end;
-
-function MaxOfArray(const A: array of Double): Double; overload;
- {Returns the maximum value contained in the given array of double precision
- floating point values.
- The array must not be empty.}
-var
- Idx: Integer;
-begin
- Assert(Length(A) > 0);
- Result := A[Low(A)];
- for Idx := Succ(Low(A)) to High(A) do
- if A[Idx] > Result then
- Result := A[Idx];
-end;
-
-function MaxOfArray(const A: array of Extended): Extended; overload;
- {Returns the maximum value contained in the given array of extended precision
- floating point values.
- The array must not be empty.}
-var
- Idx: Integer;
-begin
- Assert(Length(A) > 0);
- Result := A[Low(A)];
- for Idx := Succ(Low(A)) to High(A) do
- if A[Idx] > Result then
- Result := A[Idx];
-end;
-
-function MaxOfArray(const A: array of Int64): Int64; overload;
- {Returns the maximum value contained in the given array of 64 bit integer
- values.
- The array must not be empty.}
-var
- Idx: Integer;
-begin
- Assert(Length(A) > 0);
- Result := A[Low(A)];
- for Idx := Succ(Low(A)) to High(A) do
- if A[Idx] > Result then
- Result := A[Idx];
-end;
-
-function MaxOfArray(const A: array of Integer): Integer; overload;
- {Returns the maximum value contained in the given array of integer values.
- The array must not be empty.}
-var
- Idx: Integer;
-begin
- Assert(Length(A) > 0);
- Result := A[Low(A)];
- for Idx := Succ(Low(A)) to High(A) do
- if A[Idx] > Result then
- Result := A[Idx];
-end;
-
-function MaxOfArray(const A: array of Single): Single; overload;
- {Returns the maximum value contained in the given array of single precision
- floating point values.
- The array must not be empty.}
-var
- Idx: Integer;
-begin
- Assert(Length(A) > 0);
- Result := A[Low(A)];
- for Idx := Succ(Low(A)) to High(A) do
- if A[Idx] > Result then
- Result := A[Idx];
-end;
-
-function Mid(const A, B, C: Double): Double; overload;
- {Returns the middle of three double precision floating point values.}
-begin
- Result := Math.Min(
- Math.Min(
- Math.Max(A, B), Math.Max(B, C)
- ),
- Math.Max(A, C)
- );
-end;
-
-function Mid(const A, B, C: Extended): Extended; overload;
- {Returns the middle of three extended precision floating point values.}
-begin
- Result := Math.Min(
- Math.Min(
- Math.Max(A, B), Math.Max(B, C)
- ),
- Math.Max(A, C)
- );
-end;
-
-function Mid(const A, B, C: Int64): Int64; overload;
- {Returns the middle of three 64 bit integer values.}
-begin
- Result := Math.Min(
- Math.Min(
- Math.Max(A, B), Math.Max(B, C)
- ),
- Math.Max(A, C)
- );
-end;
-
-function Mid(const A, B, C: Integer): Integer; overload;
- {Returns the middle of three integer values.}
-begin
- Result := Math.Min(
- Math.Min(
- Math.Max(A, B), Math.Max(B, C)
- ),
- Math.Max(A, C)
- );
-end;
-
-function Mid(const A, B, C: Single): Single; overload;
- {Returns the middle of three single precision floating point values.}
-begin
- Result := Math.Min(
- Math.Min(
- Math.Max(A, B), Math.Max(B, C)
- ),
- Math.Max(A, C)
- );
-end;
-
-procedure MinMidMax(const A, B, C: Double; out Min, Mid, Max: Double); overload;
- {Finds the minimum, middle and maximum values of three double precision
- floating point numbers, A, B and C and returns them in Min, Mid and Max
- respectively.}
-var
- Temp: Double;
-begin
- if A > B then
- begin
- Max := A;
- Min := B;
- end
- else
- begin
- Max := B;
- Min := A;
- end;
- if C > Max then
- begin
- Mid := Max;
- Max := C;
- if Mid < Min then
- begin
- Temp := Mid;
- Mid := Min;
- Min := Temp;
- end;
- end
- else
- begin
- Mid := Min;
- Min := C;
- if Mid < Min then
- begin
- Temp := Mid;
- Mid := Min;
- Min := Temp;
- end;
- end;
-end;
-
-procedure MinMidMax(const A, B, C: Extended; out Min, Mid, Max: Extended);
- overload;
- {Finds the minimum, middle and maximum values of three extended precision
- floating point numbers, A, B and C and returns them in Min, Mid and Max
- respectively.}
-var
- Temp: Extended;
-begin
- if A > B then
- begin
- Max := A;
- Min := B;
- end
- else
- begin
- Max := B;
- Min := A;
- end;
- if C > Max then
- begin
- Mid := Max;
- Max := C;
- if Mid < Min then
- begin
- Temp := Mid;
- Mid := Min;
- Min := Temp;
- end;
- end
- else
- begin
- Mid := Min;
- Min := C;
- if Mid < Min then
- begin
- Temp := Mid;
- Mid := Min;
- Min := Temp;
- end;
- end;
-end;
-
-procedure MinMidMax(const A, B, C: Int64; out Min, Mid, Max: Int64); overload;
- {Finds the minimum, middle and maximum values of three 64 bit integers, A, B
- and C and returns them in Min, Mid and Max respectively.}
-var
- Temp: Int64;
-begin
- if A > B then
- begin
- Max := A;
- Min := B;
- end
- else
- begin
- Max := B;
- Min := A;
- end;
- if C > Max then
- begin
- Mid := Max;
- Max := C;
- if Mid < Min then
- begin
- Temp := Mid;
- Mid := Min;
- Min := Temp;
- end;
- end
- else
- begin
- Mid := Min;
- Min := C;
- if Mid < Min then
- begin
- Temp := Mid;
- Mid := Min;
- Min := Temp;
- end;
- end;
-end;
-
-procedure MinMidMax(const A, B, C: Integer; out Min, Mid, Max: Integer);
- overload;
- {Finds the minimum, middle and maximum values of three integers, A, B and C
- and returns them in Min, Mid and Max respectively.}
-var
- Temp: Integer;
-begin
- if A > B then
- begin
- Max := A;
- Min := B;
- end
- else
- begin
- Max := B;
- Min := A;
- end;
- if C > Max then
- begin
- Mid := Max;
- Max := C;
- if Mid < Min then
- begin
- Temp := Mid;
- Mid := Min;
- Min := Temp;
- end;
- end
- else
- begin
- Mid := Min;
- Min := C;
- if Mid < Min then
- begin
- Temp := Mid;
- Mid := Min;
- Min := Temp;
- end;
- end;
-end;
-
-procedure MinMidMax(const A, B, C: Single; out Min, Mid, Max: Single); overload;
- {Finds the minimum, middle and maximum values of three single precision
- floating point numbers, A, B and C and returns them in Min, Mid and Max
- respectively.}
-var
- Temp: Single;
-begin
- if A > B then
- begin
- Max := A;
- Min := B;
- end
- else
- begin
- Max := B;
- Min := A;
- end;
- if C > Max then
- begin
- Mid := Max;
- Max := C;
- if Mid < Min then
- begin
- Temp := Mid;
- Mid := Min;
- Min := Temp;
- end;
- end
- else
- begin
- Mid := Min;
- Min := C;
- if Mid < Min then
- begin
- Temp := Mid;
- Mid := Min;
- Min := Temp;
- end;
- end;
-end;
-
-function MinOfArray(const A: array of Double): Double; overload;
- {Returns the minimum value contained in the given array of double precision
- floating point values.
- The array must not be empty.}
-var
- Idx: Integer;
-begin
- Assert(Length(A) > 0);
- Result := A[Low(A)];
- for Idx := Succ(Low(A)) to High(A) do
- if A[Idx] < Result then
- Result := A[Idx];
-end;
-
-function MinOfArray(const A: array of Extended): Extended; overload;
- {Returns the minimum value contained in the given array of extended precision
- floating point values.
- The array must not be empty.}
-var
- Idx: Integer;
-begin
- Assert(Length(A) > 0);
- Result := A[Low(A)];
- for Idx := Succ(Low(A)) to High(A) do
- if A[Idx] < Result then
- Result := A[Idx];
-end;
-
-function MinOfArray(const A: array of Int64): Int64; overload;
- {Returns the minimum value contained in the given array of 64 bit integer
- values.
- The array must not be empty.}
-var
- Idx: Integer;
-begin
- Assert(Length(A) > 0);
- Result := A[Low(A)];
- for Idx := Succ(Low(A)) to High(A) do
- if A[Idx] < Result then
- Result := A[Idx];
-end;
-
-function MinOfArray(const A: array of Integer): Integer; overload;
- {Returns the minimum value contained in the given array of integer values.
- The array must not be empty.}
-var
- Idx: Integer;
-begin
- Assert(Length(A) > 0);
- Result := A[Low(A)];
- for Idx := Succ(Low(A)) to High(A) do
- if A[Idx] < Result then
- Result := A[Idx];
-end;
-
-function MinOfArray(const A: array of Single): Single; overload;
- {Returns the minimum value contained in the given array of single precision
- floating point values.
- The array must not be empty.}
-var
- Idx: Integer;
-begin
- Assert(Length(A) > 0);
- Result := A[Low(A)];
- for Idx := Succ(Low(A)) to High(A) do
- if A[Idx] < Result then
- Result := A[Idx];
-end;
-
-function MoveRectToOrigin(const R: Types.TRect): Types.TRect;
- {Translates the give rectangle to the origin.
- The top and left co-ordinates are set to zero and the bottom and right
- co-ordinates are adjusted accordingly.}
-begin
- Result := R;
- Types.OffsetRect(Result, -R.Left, -R.Top);
-end;
-
-procedure NormaliseFractionSign(var Num, Denom: Integer);
- {Normalises the sign of the fraction with numerator Num and denominator Denom
- so that Num takes the sign of the fraction and Denom is non-negative.}
-begin
- if Denom < 0 then
- begin
- Num := -Num;
- Denom := -Denom;
- end;
-end;
-
-function NormalizeRect(const R: Windows.TRect): Windows.TRect;
- {Normalises the given rectangle so that Left <= Right and Top <= Bottom.}
-begin
- Result := R;
- if Result.Left > Result.Right then
- ExchangeInt(Result.Left, Result.Right);
- if Result.Top > Result.Bottom then
- ExchangeInt(Result.Top, Result.Bottom);
-end;
-
-function PointF(const AX, AY: Double): TPointF;
- {Constructs and returns a TPointF record with the given x & y coordinates.}
-begin
- Result.X := AX;
- Result.Y := AY;
-end;
-
-function Pow(const Base: Int64; const Exponent: Byte): Int64;
- {Raises integer value Base to non-negative integer power Exponent and returns
- the result.}
-var
- I: Byte;
-begin
- Result := 1;
- for I := 1 to Exponent do
- Result := Result * Base;
-end;
-
-function RectArea(const R: Windows.TRect): Int64;
- {Returns the area of the given rectangle.}
-begin
- Result := Abs((R.Right - R.Left) * (R.Bottom - R.Top));
-end;
-
-function RectF(const ALeft, ATop, ARight, ABottom: Double): TRectF;
- {Constructs and returns a TRectF record with the given left, top, right &
- bottom coordinates.}
-begin
- Result.Left := ALeft;
- Result.Top := ATop;
- Result.Right := ARight;
- Result.Bottom := ABottom;
-end;
-
-function RectHeight(const R: Windows.TRect): Integer;
- {Returns the height of the given rectangle.
- The return value is always non-negative even if the rectangle is not
- normalized.}
-begin
- Result := R.Bottom - R.Top;
- if Result < 0 then
- Result := -Result;
-end;
-
-function RectSize(const R: Windows.TRect): Windows.TSize;
- {Returns the size of the given rectangle.
- The returned dimensions are always non-negative even if the rectangle is not
- normalized.}
-begin
- Result.cx := RectWidth(R);
- Result.cy := RectHeight(R);
-end;
-
-function RectWidth(const R: Windows.TRect): Integer;
- {Returns the width of the given rectangle.
- The return value is always non-negative even if the rectangle is not
- normalized.}
-begin
- Result := R.Right - R.Left;
- if Result < 0 then
- Result := -Result;
-end;
-
-function RepeatedDigits(N: Int64): Boolean;
- {Checks if the given integer contains only a single repeated digit.}
-begin
- N := Abs(N);
- if N > 0 then
- Result :=
- N = SysUtils.StrToInt64(
- StringOfChar(
- Char(48 + N mod 10),
- Succ(Math.Floor(Math.Log10(N)))
- )
- )
- else
- Result := True;
-end;
-
-function ResizeRect(const R: Types.TRect; const NewSize: Types.TSize):
- Types.TRect; overload;
- {Resizes rectangle R to size NewSize, leaving the top-left position unchanged.
- Returns the resized rectangle.}
-begin
- Result := ResizeRect(R, NewSize.CX, NewSize.CY);
-end;
-
-function ResizeRect(const R: Types.TRect; const NewWidth, NewHeight: LongInt):
- Types.TRect; overload;
- {Resizes rectangle R to the width and height given by NewWidth and NewHeight,
- leaving the top-left position unchanged.
- Returns the resized rectangle.}
-begin
- Result := Types.Bounds(R.Left, R.Top, NewWidth, NewHeight);
-end;
-
-function ReverseNumber(AValue: Int64): Int64;
- {Reverses the digits of the given integer and returns the resulting value.
- The given integer should be greater than zero: the function always returns
- zero for negative integers.}
-begin
- Result := 0;
- while AValue > 0 do
- begin
- Result := (Result * 10) + (AValue mod 10);
- AValue := AValue div 10;
- end;
-end;
-
-function ReverseNumberR(AValue: Int64): Int64;
- {Reverses the digits of the given integer, which must be non-negative, and
- returns the resulting value.
- Uses recursion.}
-begin
- Assert(AValue >= 0);
- if AValue mod 10 = AValue then
- Result := AValue
- else
- Result := ((AValue mod 10) * Trunc(IntPower(10, Trunc(Log10(AValue)))))
- + ReverseNumberR(AValue div 10)
-end;
-
-function SAR(Value: LongInt; Shift: Byte): LongInt;
- {Performs an arithmetic right shift operation on the given value and returns
- the result. Value is shifted right by Shift bits.
- Shift must be in the range 0..31 and is adjusted if it is not.}
-begin
- Shift := Shift and 31;
- if Shift = 0 then
- begin
- Result := Value;
- Exit;
- end;
- Result := LongInt(LongWord(Value) shr Shift);
- if Value < 0 then
- Result := LongInt(LongWord(Result) or ($FFFFFFFF shl (32 - Shift)));
-end;
-
-function ScaleRect(const ARect: Types.TRect; AScaling: Double): Types.TRect;
- {Scales the given rectangle by the given scale factor and returns the scaled
- rectangle.}
-begin
- Result.Left := System.Round(ARect.Left * AScaling);
- Result.Top := System.Round(ARect.Top * AScaling);
- Result.Right := System.Round(ARect.Right * AScaling);
- Result.Bottom := System.Round(ARect.Bottom * AScaling);
-end;
-
-function SignOfFloat(const Value: Extended): Integer;
- {Returns the sign of the given floating point value. Returns -1 if the value
- is positive, 0 if zero or +1 if negative.}
-begin
- if Value < 0.0 then
- Result := -1
- else if Value = 0.0 then
- Result := 0
- else
- Result := 1;
-end;
-
-function SignOfInt(const Value: Int64): Integer;
- {Returns the sign of the given integer. Returns -1 if the integer is positive,
- 0 if zero or +1 if negative.}
-begin
- if Value < 0 then
- Result := -1
- else if Value = 0 then
- Result := 0
- else
- Result := 1;
-end;
-
-function Size(const ACX, ACY: Integer): Types.TSize;
- {Constructs and returns a TSize record with the given dimensions.}
-begin
- Result.cx := ACX;
- Result.cy := ACY;
-end;
-
-function StretchRect(const R: Types.TRect; const ScalingX, ScalingY: Double):
- Types.TRect; overload;
- {Stretches rectangle R by the given scaling factors and returns the result.
- The rectangle's width is scaled by ScalingX and its height by ScalingY.
- The top left corner of the rectangle is not changed.}
-{$IFDEF FPC}
-const
-{$ELSE}
-resourcestring
-{$ENDIF}
- sErrorMsg = 'StretchRect(): Rectangle bottom or right out of bounds.';
-var
- NewW, NewH: Double; // stretched width and height of rectangle
-begin
- NewW := (R.Right - R.Left) * ScalingX;
- NewH := (R.Bottom - R.Top) * ScalingY;
- if (Abs(NewW + R.Left) > High(LongInt))
- or (Abs(NewH + R.Top) > High(LongInt)) then
- raise SysUtils.EOverflow.Create(sErrorMsg);
- Result := Types.Bounds(R.Left, R.Top, System.Round(NewW), System.Round(NewH));
-end;
-
-function StretchRect(const R: Types.TRect; const Scaling: Double):
- Types.TRect; overload;
- {Stretches the rectangle R by scale factor Scaling and returns the result.
- Both width and height are stretched by the same scale factor.
- The top left corner is not changed.}
-begin
- Result := StretchRect(R, Scaling, Scaling);
-end;
-
-function ZoomRatio(const DestWidth, DestHeight, SrcWidth, SrcHeight: Integer):
- Double; overload;
- {Calculates and returns the largest scaling that can be applied to a rectangle
- of width SrcWidth and height SrcHeight to fit it, without changing the aspect
- ratio, within a second rectangle of width DestWidth and height DestHeight.}
-begin
- Result := Math.Min(DestWidth / SrcWidth, DestHeight / SrcHeight);
-end;
-
-function ZoomRatio(const DestSize, SrcSize: Types.TSize): Double; overload;
- {Calculates and returns the largest scaling that can be applied to a rectangle
- of size SrcSize to fit it, without changing the aspect ratio, within a second
- rectangle of size DestSize.}
-begin
- Result := ZoomRatio(DestSize.cx, DestSize.cy, SrcSize.cx, SrcSize.cy);
-end;
-
-function ZoomRatio(const DestRect, SrcRect: Types.TRect): Double; overload;
- {Calculates and returns the largest scaling that can be applied to rectangle
- SrcRect to fit it, without changing the aspect ratio, within rectangle
- DestRect.}
-begin
- Result := ZoomRatio(RectSize(DestRect), RectSize(SrcRect));
-end;
-
-constructor TSizeEx.Create(ACX, ACY: Integer);
-begin
- CX := ACX;
- CY := ACY;
-end;
-
-class operator TSizeEx.Equal(S1, S2: TSizeEx): Boolean;
-begin
- // zero records are special: can be zero when only one of CX or CY is zero
- if S1.IsZero and S2.IsZero then
- begin
- Result := True;
- Exit;
- end;
- Result := (S1.CX = S1.CX) and (S1.CY = S2.CY);
-end;
-
-class operator TSizeEx.Implicit(S: Types.TSize): TSizeEx;
-begin
- Result.CX := S.cx;
- Result.CY := S.cy;
-end;
-
-class operator TSizeEx.Implicit(S: TSizeEx): Types.TSize;
-begin
- Result.cx := S.CX;
- Result.cy := S.CY;
-end;
-
-function TSizeEx.IsZero: Boolean;
-begin
- Result := (CX = 0) or (CY = 0);
-end;
-
-class operator TSizeEx.NotEqual(S1, S2: TSizeEx): Boolean;
-begin
- Result := not (S1 = S2);
-end;
-
-end.
diff --git a/csdb/tests/Cat-String/UStringCatSnippets.pas b/csdb/tests/Cat-String/UStringCatSnippets.pas
deleted file mode 100644
index af48d1c..0000000
--- a/csdb/tests/Cat-String/UStringCatSnippets.pas
+++ /dev/null
@@ -1,128 +0,0 @@
-{
- * This file was generated from the DelphiDabbler Code Snippets Database.
- * The source code is licensed under the MIT license, copyright © 2005-2021,
- * Peter Johnson (https://gravatar.com/delphidabbler) and Contributors. The
- * full license and a list of contributors can be found in the `LICENSE` and
- * `CONTRIBUTORS` files at
- * https://github.com/delphidabbler/code-snippets/tree/master/csdb/collection
-}
-
-unit UStringCatSnippets;
-
-{$IFNDEF FPC}
- {$IFDEF CONDITIONALEXPRESSIONS}
- {$IF CompilerVersion >= 14.00}
- {$WARN SYMBOL_PLATFORM OFF}
- {$WARN SYMBOL_DEPRECATED OFF}
- {$WARN SYMBOL_LIBRARY OFF}
- {$IFEND}
- {$IF CompilerVersion >= 15.00}
- {$WARN UNSAFE_TYPE OFF}
- {$WARN UNSAFE_CAST OFF}
- {$WARN UNSAFE_CODE OFF}
- {$IFEND}
- {$IF CompilerVersion >= 20.00}
- {$WARN EXPLICIT_STRING_CAST OFF}
- {$WARN IMPLICIT_STRING_CAST OFF}
- {$IFEND}
- {$ENDIF}
-{$ENDIF}
-
-interface
-
-uses
- SysUtils, StrUtils, Classes, Windows;
-
-function StripAccelChars(const S: string): string;
-
-function ReverseStr(S: string): string;
-
-function ReverseStrR(const S: string): string;
-
-function IsNumeric(Value: string; const AllowFloat: Boolean;
- const TrimWhiteSpace: Boolean = True): Boolean;
-
-function SplitString(const AText, ADelimiter: string): Classes.TStringList;
-
-procedure ParseStr(const StrToParse: string; const Delimiter: Char;
- const Words: Classes.TStringList);
-
-implementation
-
-function StripAccelChars(const S: string): string;
-begin
- Result := SysUtils.StringReplace(
- S, '&', SysUtils.EmptyStr, [SysUtils.rfReplaceAll]
- );
-end;
-
-function ReverseStr(S: string): string;
-begin
- Result := SysUtils.EmptyStr;
- while System.Length(S) > 0 do
- begin
- Result := Result + StrUtils.RightStr(S, 1);
- S := StrUtils.LeftStr(S, Pred(System.Length(S)));
- end;
-end;
-
-function ReverseStrR(const S: string): string;
-begin
- if SysUtils.AnsiSameText(S, SysUtils.EmptyStr) or (System.Length(S) = 1) then
- Result := S
- else
- Result := StrUtils.RightStr(S, 1)
- + ReverseStrR(StrUtils.LeftStr(S, System.Length(S) - 1))
-end;
-
-function IsNumeric(Value: string; const AllowFloat: Boolean;
- const TrimWhiteSpace: Boolean = True): Boolean;
-var
- ValueInt: Int64; // dummy integer value
- ValueFloat: Extended; // dummy float value
-begin
- if TrimWhiteSpace then
- Value := SysUtils.Trim(Value);
- // Check for valid integer
- Result := SysUtils.TryStrToInt64(Value, ValueInt);
- if not Result and AllowFloat then
- // Wasn't valid as integer, try float
- Result := SysUtils.TryStrToFloat(Value, ValueFloat);
-end;
-
-function SplitString(const AText, ADelimiter: string): Classes.TStringList;
-var
- LTxt, LTmp: string;
-begin
- Result := TStringList.Create;
- LTxt := AText;
- while Pos(ADelimiter, LTxt) > 0 do
- begin
- LTmp := Copy(LTxt, 1, Pos(ADelimiter, LTxt) - 1);
- Result.Add(LTmp);
- LTxt := SysUtils.StringReplace(LTxt, LTmp + ADelimiter, '', []);
- end;
- if (LTxt <> '') then
- Result.Add(LTxt);
-end;
-
-procedure ParseStr(const StrToParse: string; const Delimiter: Char;
- const Words: Classes.TStringList);
-var
- TmpInStr: string;
-begin
- TmpInStr := StrToParse;
- Words.Clear;
- if Length(TmpInStr) > 0 then
- begin
- while Pos(Delimiter, TmpInStr) > 0 do
- begin
- Words.Append(Copy(TmpInStr, 1, Pos(Delimiter, TmpInStr) - 1));
- Delete(TmpInStr, 1, Pos(Delimiter, TmpInStr));
- end;
- Words.Append(TmpInStr);
- end;
-end;
-
-end.
-
diff --git a/csdb/tests/README.md b/csdb/tests/README.md
deleted file mode 100644
index 39afed7..0000000
--- a/csdb/tests/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-# About the CodeSnippets Tests project
-
-This project provides tests and demos of snippets from the [DelphiDabbler Code Snippets Database](https://github.com/delphidabbler/code-snippets).
-
-## Directory Structure
-
-The project has the following directories:
-
-### `./`
-
-Contains:
-
-* this file: `README.md`
-* project group files for Delphi 2006..XE[[1]](#1) that group together all the sub-projects that are stored in sub-directories of `Src`.
-
-### `./Cat-Arrays`
-
-Contains the _TestArraysCat_[[2]](#2) project that provides _DUnit_ tests for snippets from the database's _Arrays_ category. Currently tests are only available for the _TArrayUtils_ advanced record.
-
-### `./Cat-Date`
-
-Contains the _TestDateCat_[[2]](#2) project that provides _DUnit_ tests for selected snippets from the database's _Date and Time_ category.
-
-### `./Cat-Drive`
-
-Contains the _TestDriveCat_[[2]](#2) project that implements a GUI application that exercises and demonstrates all the code from the database's _Drive Management_ category.
-
-### `./Cat-Hex`
-
-Contains the _TestHexCat_[[2]](#2) project that provides _DUnit_ tests for all the snippets from the database's _Hex Utilities_ category.
-
-### `./Cat-Maths`
-
-Contains the _TestCatMaths_[[2]](#2) project that provides _DUnit_ tests for selected snippets from the database's _Mathematics_ category.
-
-### `./Cat-String`
-
-Contains the _TestCatString_[[2]](#2) project that provides _DUnit_ tests for selected snippets from the database's _String Management_ category.
-
-### `./Cat-WinSys`
-
-Contains the _TextWinSysCat_[[2]](#2) project that provides a GUI application that exercises and demonstrates all the code from the database's _Windows System_ category.
-
-### History
-
-These test files originated as a [zip file on Google Drive](https://drive.google.com/file/d/1pH7LtyZY-ehwjJ4AjC801j-0bVMdLpsz/view) that were copied as is into the `csdb/tests` subdirectory of the `delphidabbler/code-snippets` repository on GitHub.
-
-All subsequent changes to the files were made on GitHub. At present the GitHub repository differs from the original code on Google Drive.
-
-## Notes
-
-### 1
-
-There are different versions of the group project file for different Delphi versions:
-
-* `CodeSnippetsTestsbdsgroup` for Delphi 2006
-* `CodeSnippetsTests.groupproj` for Delphi 2007-2010
-* `CodeSnippetsTestsXE.groupproj` for Delphi XE
-
-### 2
-
-The are different versions of project files for different versions of Delphi. They are:
-
-* `.bdsproj` for Delphi 2006
-* `.dproj` for Delphi 2007 to 2010
-* `XE.dproj` for Delphi XE
-
-where `` is the base name of the project, for example `TestDateCat` or `TestCatMaths`.
-
-> Not all test projects provide all the different project files versions.
diff --git a/csdb/docs/collection-format.html b/docs/collection-format.html
similarity index 57%
rename from csdb/docs/collection-format.html
rename to docs/collection-format.html
index 34ac514..509527c 100644
--- a/csdb/docs/collection-format.html
+++ b/docs/collection-format.html
@@ -1,8 +1,8 @@
diff --git a/csdb/docs/main.css b/docs/main.css
similarity index 97%
rename from csdb/docs/main.css
rename to docs/main.css
index a722219..6a1dad2 100644
--- a/csdb/docs/main.css
+++ b/docs/main.css
@@ -1,5 +1,5 @@
/*
- * This file copyright (C) 2020, Peter Johnson (gravatar.com/delphidabbler) and
+ * This file copyright (C) 2020-2025, Peter Johnson (gravatar.com/delphidabbler) and
* is licensed under the MIT License: https://opensource.org/licenses/MIT
*
* DelphiDabbler Code Snippets Database Documentation: CSS used by all
@@ -128,7 +128,7 @@ code.key, code.value {
}
code.key {
font-weight: bold;
- font-style: none;
+ font-style: normal;
}
code.value {
font-style: normal;
diff --git a/docs/reml.html b/docs/reml.html
new file mode 100644
index 0000000..01e5092
--- /dev/null
+++ b/docs/reml.html
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DelphiDabbler Code Snippets Database Docs - REML
+
+
+
+
+
+
+
+
+
+
+
+ About REML
+
+
+
+ REML is a little markup language that can be used to style text. It is used in the Code Snippets collection's meta data for certain properties of a snippet.
+
+
+
+ REML is a SGML language similar to HTML, albeit much smaller. A small number of tags and character entities are supported.
+
+
+
+ This collection supports REML v4. Earlier versions are obsolete.
+ See the REML v4 language definition from the delphidabbler/reml repository for full details.
+
+
+
+
+ Before v2.1.0 of the collection, not all REML content was fully compliant with the specification: some text did not have enclosing block tags. Any REML interpreter designed to work with those versions must handle such text "permissively" as described in the language definition.
+
+
+ From v2.1.0 the collection is fully compliant with the REML specification. Any interpreters that only need to handle v2.1.0 and later are not required to handle text outside enclosing tags.
+
+
+
+
+
+
+
+
+ Examples
+
+
+
+ Here are some examples of valid REML markup.
+
+
+ <heading>Hello</heading>
+<p>Hello World</p>
+
+ <p>Make stuff <strong>stand out</strong>.</p>
+
+ <p><em>Emphasised <warning>warning!</warning></em></p>
+
+ <p>Refer to a function <var>parameter</var>.</p>
+
+ <p>Use the: <mono>Windows</mono> unit.</p>
+
+ <p>See this <a href="http://example.com/">example</a>.</p>
+
+ <p>Sometimes "character entities" are needed.</p>
+
+
+
+
+
+
diff --git a/csdb/docs/source-code-format.html b/docs/source-code-format.html
similarity index 94%
rename from csdb/docs/source-code-format.html
rename to docs/source-code-format.html
index f97bf66..6b25561 100644
--- a/csdb/docs/source-code-format.html
+++ b/docs/source-code-format.html
@@ -1,7 +1,7 @@