From dea1de1eb6cdaa5e177f567599b36e3b8b0a6c54 Mon Sep 17 00:00:00 2001 From: Mikhalkovich Stanislav Date: Sun, 1 Aug 2021 22:29:46 +0300 Subject: [PATCH] =?UTF-8?q?Min(Seq(1,2,3))=20=D1=82=D0=B5=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D1=8C=20=D0=B2=D1=8B=D0=B4=D0=B0=D1=91=D1=82=20=D0=BE?= =?UTF-8?q?=D1=88=D0=B8=D0=B1=D0=BA=D1=83=20=D0=B2=D1=8B=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20(=D1=80=D0=B0=D0=BD=D1=8C?= =?UTF-8?q?=D1=88=D0=B5=20=D0=BD=D0=B5=D0=BE=D1=87=D0=B5=D0=B2=D0=B8=D0=B4?= =?UTF-8?q?=D0=BD=D0=BE=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=BB=D0=B0?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 2 +- Release/pabcversion.txt | 2 +- ReleaseGenerators/PascalABCNET_version.nsh | 2 +- TestSuite/CompilationSamples/PABCSystem.pas | 18 +++++++++++++++--- bin/Lib/PABCSystem.pas | 18 +++++++++++++++--- 6 files changed, 34 insertions(+), 10 deletions(-) diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index ff5ef55be..7b788f2e1 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "8"; public const string Build = "0"; - public const string Revision = "2949"; + public const string Revision = "2951"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index 0b4e5da98..cde9c1f76 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %MINOR%=8 -%REVISION%=2949 +%REVISION%=2951 %COREVERSION%=0 %MAJOR%=3 diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index e02f1cf97..c23d45083 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.8.0.2949 +3.8.0.2951 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 7d7df7f46..c9bef9e4a 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.8.0.2949' +!define VERSION '3.8.0.2951' diff --git a/TestSuite/CompilationSamples/PABCSystem.pas b/TestSuite/CompilationSamples/PABCSystem.pas index a5510293d..2e7f3c4f4 100644 --- a/TestSuite/CompilationSamples/PABCSystem.pas +++ b/TestSuite/CompilationSamples/PABCSystem.pas @@ -2838,7 +2838,8 @@ const BAD_COL_INDEX_TO = 'ToCol выходит за пределы индексов строк двумерного массива!!ToCol is out of range of 2-dim array column indexes'; SLICE_SIZE_AND_RIGHT_VALUE_SIZE_MUST_BE_EQUAL = 'Размеры среза и присваиваемого выражения должны быть равны!!Slice size and assigned expression size must be equal'; MATR_DIMENSIONS_MUST_BE_EQUAL = 'Размеры матриц должны совпадать!!Matrix dimensions must be equal'; - + COUNT_PARAMS_MAXFUN_MUSTBE_GREATER1 = 'Количество параметров функции Max должно быть > 1!!The number of parameters of the Max function must be > 1'; + COUNT_PARAMS_MINFUN_MUSTBE_GREATER1 = 'Количество параметров функции Min должно быть > 1!!The number of parameters of the Min function must be > 1'; // ----------------------------------------------------- // WINAPI // ----------------------------------------------------- @@ -8474,8 +8475,19 @@ begin if d < Result then Result := d; end; -function Min(params a: array of T): T := a.Min; -function Max(params a: array of T): T := a.Max; +function Min(params a: array of T): T; +begin + if a.Length<2 then + raise new System.ArgumentException(GetTranslation(COUNT_PARAMS_MINFUN_MUSTBE_GREATER1)); + Result := a.Min; +end; + +function Max(params a: array of T): T; +begin + if a.Length<2 then + raise new System.ArgumentException(GetTranslation(COUNT_PARAMS_MAXFUN_MUSTBE_GREATER1)); + Result := a.Max; +end; {function Min(params a: array of real): real := a.Min;} diff --git a/bin/Lib/PABCSystem.pas b/bin/Lib/PABCSystem.pas index a5510293d..2e7f3c4f4 100644 --- a/bin/Lib/PABCSystem.pas +++ b/bin/Lib/PABCSystem.pas @@ -2838,7 +2838,8 @@ const BAD_COL_INDEX_TO = 'ToCol выходит за пределы индексов строк двумерного массива!!ToCol is out of range of 2-dim array column indexes'; SLICE_SIZE_AND_RIGHT_VALUE_SIZE_MUST_BE_EQUAL = 'Размеры среза и присваиваемого выражения должны быть равны!!Slice size and assigned expression size must be equal'; MATR_DIMENSIONS_MUST_BE_EQUAL = 'Размеры матриц должны совпадать!!Matrix dimensions must be equal'; - + COUNT_PARAMS_MAXFUN_MUSTBE_GREATER1 = 'Количество параметров функции Max должно быть > 1!!The number of parameters of the Max function must be > 1'; + COUNT_PARAMS_MINFUN_MUSTBE_GREATER1 = 'Количество параметров функции Min должно быть > 1!!The number of parameters of the Min function must be > 1'; // ----------------------------------------------------- // WINAPI // ----------------------------------------------------- @@ -8474,8 +8475,19 @@ begin if d < Result then Result := d; end; -function Min(params a: array of T): T := a.Min; -function Max(params a: array of T): T := a.Max; +function Min(params a: array of T): T; +begin + if a.Length<2 then + raise new System.ArgumentException(GetTranslation(COUNT_PARAMS_MINFUN_MUSTBE_GREATER1)); + Result := a.Min; +end; + +function Max(params a: array of T): T; +begin + if a.Length<2 then + raise new System.ArgumentException(GetTranslation(COUNT_PARAMS_MAXFUN_MUSTBE_GREATER1)); + Result := a.Max; +end; {function Min(params a: array of real): real := a.Min;}