Модуль Countries и стандартный каталог для файлов

This commit is contained in:
miks1965 2018-08-06 14:49:41 +03:00
parent 1fc770e749
commit 00e0d8082d
10 changed files with 74 additions and 55 deletions

View file

@ -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;

View file

@ -1,4 +1,4 @@
%MINOR%=4
%REVISION%=1726
%COREVERSION%=0
%REVISION%=1727
%MINOR%=4
%MAJOR%=3

View file

@ -1 +1 @@
!define VERSION '3.4.0.1726'
!define VERSION '3.4.0.1727'

View file

@ -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));

View file

@ -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"

View file

@ -1,4 +1,4 @@
Section "Files" Files
Section $(DESC_Files) Files
SectionIn 1
SetOutPath "$INSTDIR\Files\Databases"

View file

@ -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

View file

@ -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 !!!!!!!

View file

@ -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)
{

View file

@ -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