diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 8df7318df..8b9be0557 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 = "4"; public const string Build = "0"; - public const string Revision = "1726"; + public const string Revision = "1727"; 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 4e2ce412f..b0ea34ed2 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%MINOR%=4 -%REVISION%=1726 %COREVERSION%=0 +%REVISION%=1727 +%MINOR%=4 %MAJOR%=3 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 422960dab..2e3127459 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.4.0.1726' +!define VERSION '3.4.0.1727' diff --git a/ReleaseGenerators/RebuildStandartModules.pas b/ReleaseGenerators/RebuildStandartModules.pas index d37303afe..355c5ebe0 100644 --- a/ReleaseGenerators/RebuildStandartModules.pas +++ b/ReleaseGenerators/RebuildStandartModules.pas @@ -9,7 +9,7 @@ NumLibABC, IniFile, PointerTools, PointRect, PT4, PT4MakerNetX, Robot, RobotField, RobotTaskMaker, RobotZadan, Sockets, Utils, VCL, Timers, PT4Exam, PT4TaskMakerNET, RBDMUtils, - Collections, Arrays, Core, FormsABC, MPI, ClientServer, OpenGL, Speech, Sounds; + Collections, Arrays, Core, FormsABC, MPI, ClientServer, OpenGL, Speech, Sounds, Countries; begin writeln(cos(pi)); diff --git a/ReleaseGenerators/sect_Core.nsh b/ReleaseGenerators/sect_Core.nsh index 2be54d57f..95f909969 100644 --- a/ReleaseGenerators/sect_Core.nsh +++ b/ReleaseGenerators/sect_Core.nsh @@ -83,6 +83,7 @@ File ..\bin\Lib\NumLibABC.pcu File ..\bin\Lib\GraphWPFBase.pcu File ..\bin\Lib\GraphWPF.pcu + File ..\bin\Lib\Countries.pcu File ..\bin\Lib\Graph3D.pcu File ..\bin\Lib\GraphABCHelper.pcu File ..\bin\Lib\IniFile.pcu @@ -138,6 +139,7 @@ ${AddFile} "NumLibABC.pcu" ${AddFile} "GraphWPFBase.pcu" ${AddFile} "GraphWPF.pcu" + ${AddFile} "Countries.pcu" ${AddFile} "Graph3D.pcu" ${AddFile} "GraphABCHelper.pcu" ${AddFile} "IniFile.pcu" @@ -204,6 +206,7 @@ File ..\bin\Lib\NumLibABC.pas File ..\bin\Lib\GraphWPFBase.pas File ..\bin\Lib\GraphWPF.pas + File ..\bin\Lib\Countries.pas File ..\bin\Lib\Graph3D.pas File ..\bin\Lib\GraphABCHelper.pas File ..\bin\Lib\IniFile.pas @@ -256,6 +259,7 @@ ${AddFile} "NumLibABC.pas" ${AddFile} "GraphWPFBase.pas" ${AddFile} "GraphWPF.pas" + ${AddFile} "Countries.pas" ${AddFile} "Graph3D.pas" ${AddFile} "GraphABCHelper.pas" ${AddFile} "IniFile.pas" diff --git a/ReleaseGenerators/sect_Files.nsh b/ReleaseGenerators/sect_Files.nsh index 0890cfdd7..a3c139475 100644 --- a/ReleaseGenerators/sect_Files.nsh +++ b/ReleaseGenerators/sect_Files.nsh @@ -1,4 +1,4 @@ -Section "Files" Files +Section $(DESC_Files) Files SectionIn 1 SetOutPath "$INSTDIR\Files\Databases" diff --git a/TestSuite/CompilationSamples/PABCSystem.pas b/TestSuite/CompilationSamples/PABCSystem.pas index b3d81100b..19087ca74 100644 --- a/TestSuite/CompilationSamples/PABCSystem.pas +++ b/TestSuite/CompilationSamples/PABCSystem.pas @@ -1981,6 +1981,8 @@ function IsUnix: boolean; function ExecuteAssemlyIsDll: boolean; ///-- function __StandardFilesDirectory: string; +///-- +function __FindFile(filename: string): string; // ----------------------------------------------------- // Internal for OpenMPSupport @@ -11194,6 +11196,18 @@ begin // Грубо. Исправить, сделав поиск Result := 'C:\Program Files (x86)\PascalABC.NET\Files\'; end; + +function __FindFile(filename: string): string; +begin + Result := __StandardFilesDirectory+filename; + if not FileExists(Result) then + Result := ''; + if Result = '' then + Result := filename; + if not FileExists(Result) then + Result := ''; +end; + //------------------------------------------------------------------------------ //OMP diff --git a/TreeConverter/SystemLib/StaticSystemLib.cs b/TreeConverter/SystemLib/StaticSystemLib.cs index 9d7bd91ae..0d139d1ce 100644 --- a/TreeConverter/SystemLib/StaticSystemLib.cs +++ b/TreeConverter/SystemLib/StaticSystemLib.cs @@ -2031,7 +2031,7 @@ namespace PascalABCCompiler.SystemLibrary // SSM 21.07.18 закомментировал четыре строчки выше, т.к. они давали неоднозначность при decimal(2.5). // Теперь из real в decimal и из single в decimal возможно только явное преобразование - // Из longword в decimal и из uint64 в decimal существуют как явное, так и неявное преобразованя + // Из longword в decimal и из uint64 в decimal существуют как явное, так и неявное преобразования // Это полностью соответствует тому, что в C# // забавно, но make_type_conversion_use_ctor используется ТОЛЬКО тут и ТОЛЬКО для типа decimal !!!!!!! diff --git a/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs b/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs index eddecea3b..1738ae4be 100644 --- a/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs +++ b/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs @@ -1810,6 +1810,8 @@ namespace PascalABCCompiler.TreeConverter } } else if ((parameters.Count == 0 && fn.parameters.Count == 1) && fn.parameters[0].is_params && !set_of_possible_functions.Contains(fn)) + // SSM 6.08.18 - так просто исправить не получается - видимо, сопоставление параметров работает неверно + //else if ((parameters.Count == fn.parameters.Count - 1) && fn.parameters[fn.parameters.Count-1].is_params && !set_of_possible_functions.Contains(fn)) set_of_possible_functions.AddElement(fn); else if (fn.num_of_default_parameters != 0 && parameters.Count >= fn.parameters.Count - fn.num_of_default_parameters) { diff --git a/bin/Lib/PABCSystem.pas b/bin/Lib/PABCSystem.pas index b3d81100b..220ac3d6a 100644 --- a/bin/Lib/PABCSystem.pas +++ b/bin/Lib/PABCSystem.pas @@ -1981,6 +1981,8 @@ function IsUnix: boolean; function ExecuteAssemlyIsDll: boolean; ///-- function __StandardFilesDirectory: string; +///-- +function __FindFile(filename: string): string; // ----------------------------------------------------- // Internal for OpenMPSupport @@ -7797,47 +7799,15 @@ begin value := Res; end; -function StrToInt64(s: string): int64; -begin - Result := Convert.ToInt64(s); -end; +function StrToInt64(s: string) := Convert.ToInt64(s); +function StrToReal(s: string) := Convert.ToDouble(s, nfi); +function StrToFloat(s: string) := StrToReal(s); -function StrToFloat(s: string): real; -begin - Result := Convert.ToDouble(s, nfi); -end; - -function StrToReal(s: string) := StrToFloat(s); - -function TryStrToInt64(s: string; var value: int64): boolean; -begin - Result := int64.TryParse(s, value); -end; - -function TryStrToFloat(s: string; var value: real): boolean; -begin - try - Result := True; - value := Convert.ToDouble(s, nfi); - except - value := 0; - Result := False; - end; -end; - -function TryStrToFloat(s: string; var value: single): boolean; -begin - try - Result := True; - value := Convert.ToSingle(s, nfi); - except - value := 0; - Result := False; - end; -end; - -function TryStrToReal(s: string; var value: real) := TryStrToFloat(s, value); -function TryStrToSingle(s: string; var value: single) := TryStrToFloat(s, value); +function TryStrToInt64(s: string; var value: int64) := int64.TryParse(s, value); +function TryStrToReal(s: string; var value: real) := real.TryParse(s,System.Globalization.NumberStyles.Float,nil,value); +function TryStrToSingle(s: string; var value: single) := single.TryParse(s,System.Globalization.NumberStyles.Float,nil,value); +function TryStrToFloat(s: string; var value: real) := TryStrToReal(s, value); +function TryStrToFloat(s: string; var value: single) := TryStrToSingle(s, value); function ReadIntegerFromString(s: string; var from: integer): integer; begin @@ -10187,21 +10157,38 @@ begin end; /// Преобразует строку в целое -function ToInteger(Self: string): integer; extensionmethod; -begin - Result := integer.Parse(Self); -end; +function ToInteger(Self: string): integer; extensionmethod := integer.Parse(Self); /// Преобразует строку в BigInteger -function ToBigInteger(Self: string): BigInteger; extensionmethod; +function ToBigInteger(Self: string): BigInteger; extensionmethod := BigInteger.Parse(Self); + +/// Преобразует строку в вещественное +function ToReal(Self: string): real; extensionmethod := real.Parse(Self, nfi); + +/// Преобразует строку в целое и записывает его в value. +///При невозможности преобразования возвращается False +function TryToInteger(Self: string; var value: integer): boolean; extensionmethod := TryStrToInt(Self,value); + +/// Преобразует строку в вещественное и записывает его в value. +///При невозможности преобразования возвращается False +function TryToReal(Self: string; var value: real): boolean; extensionmethod := TryStrToReal(Self,value); + +/// Преобразует строку в целое +///При невозможности преобразования возвращается defaultvalue +function ToInteger(Self: string; defaultvalue: integer): integer; extensionmethod; begin - Result := BigInteger.Parse(Self); + var b := TryStrToInt(Self,Result); + if not b then + Result := defaultvalue end; /// Преобразует строку в вещественное -function ToReal(Self: string): real; extensionmethod; +///При невозможности преобразования возвращается defaultvalue +function ToReal(Self: string; defaultvalue: real): real; extensionmethod; begin - Result := real.Parse(Self, nfi); + var b := TryStrToReal(Self,Result); + if not b then + Result := defaultvalue end; /// Преобразует строку в массив слов @@ -11194,6 +11181,18 @@ begin // Грубо. Исправить, сделав поиск Result := 'C:\Program Files (x86)\PascalABC.NET\Files\'; end; + +function __FindFile(filename: string): string; +begin + Result := __StandardFilesDirectory+filename; + if not FileExists(Result) then + Result := ''; + if Result = '' then + Result := filename; + if not FileExists(Result) then + Result := ''; +end; + //------------------------------------------------------------------------------ //OMP