Matr из массивов в PABCSystem.pas

WPFObjects - fix hide text
This commit is contained in:
Mikhalkovich Stanislav 2019-12-21 23:25:39 +03:00
parent 1aeb653f85
commit 4bb828705d
11 changed files with 101 additions and 12 deletions

View file

@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "5";
public const string Build = "1";
public const string Revision = "2277";
public const string Revision = "2281";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%MINOR%=5
%REVISION%=2277
%REVISION%=2281
%COREVERSION%=1
%MAJOR%=3

View file

@ -1 +1 @@
3.5.1.2277
3.5.1.2281

View file

@ -1 +1 @@
!define VERSION '3.5.1.2277'
!define VERSION '3.5.1.2281'

View file

@ -1926,6 +1926,8 @@ function ReadArrString(prompt: string; n: integer): array of string;
// -----------------------------------------------------
/// Возвращает двумерный массив размера m x n, заполненный указанными значениями по строкам
function Matr<T>(m,n: integer; params data: array of T): array [,] of T;
/// Возвращает двумерный массив, заполненный значениями из одномерных массивов
function Matr<T>(params aa: array of array of T): array [,] of T;
/// Возвращает двумерный массив размера m x n, заполненный случайными целыми значениями
function MatrRandom(m: integer := 5; n: integer := 5; a: integer := 0; b: integer := 100): array [,] of integer;
/// Возвращает двумерный массив размера m x n, заполненный случайными целыми значениями
@ -4066,19 +4068,17 @@ begin
Result := Result.Concat(a);
end;
///--
function operator*<T>(a: sequence of T; n: integer): sequence of T; extensionmethod;
{function operator*<T>(a: sequence of T; n: integer): sequence of T; extensionmethod;
begin
Result := System.Linq.Enumerable.Empty&<T>();
loop n do
Result := Result.Concat(a);
end;
///--
function operator*<T>(n: integer; a: sequence of T): sequence of T; extensionmethod;
begin
Result := a * n;
end;
end;}
///--
function operator in<T>(x: T; Self: sequence of T): boolean; extensionmethod;
@ -10046,6 +10046,18 @@ begin
end;
end;
function Matr<T>(params aa: array of array of T): array [,] of T;
begin
var cols := aa.Max(a -> a.Length);
var r := new T[aa.Length,cols];
for var i:=0 to aa.Length-1 do
for var j:=0 to aa[i].Length-1 do
r[i,j] := aa[i][j];
Result := r;
end;
// Реализация операций с матрицами - только после введения RowCount и ColCount
function MatrRandom(m: integer; n: integer; a, b: integer): array [,] of integer;
begin

View file

@ -230,7 +230,7 @@ type
/// Видимость графического объекта
property Visible: boolean
read InvokeBoolean(()->ob.Visibility = Visibility.Visible)
write Invoke(procedure -> if value then ob.Visibility := Visibility.Visible else ob.Visibility := Visibility.Hidden);
write Invoke(procedure -> if value then begin gr.Visibility := Visibility.Visible; ob.Visibility := Visibility.Visible end else begin gr.Visibility := Visibility.Hidden; ob.Visibility := Visibility.Hidden end);
/// Выравнивание текста внутри графического объекта
property TextAlignment: Alignment write Invoke(WTA,Value);
/// Размер шрифта текста внутри графического объекта

View file

@ -0,0 +1,31 @@
var s: integer;
type
IA = interface
procedure P();
end;
A = class(IA)
public
{procedure P();
begin
end;}
procedure IA.P();
begin
s := 1;
end;
end;
B = class(A, IA)
public
procedure IA.P();
begin
s := 2;
end;
end;
begin
var b1 := new B;
IA(b1).P;
Assert(s=2)
end.

View file

@ -0,0 +1,31 @@
var s: integer;
type
IA = interface
procedure P();
end;
A = class(IA)
public
{procedure P();
begin
end;}
procedure IA.P();
begin
s := 1;
end;
end;
B = class(A, IA)
public
{procedure IA.P();
begin
s := 2;
end;}
end;
begin
var b1 := new B;
IA(b1).P;
Assert(s=1)
end.

View file

@ -989,7 +989,7 @@ namespace PascalABCCompiler.TreeConverter
{
compar = si.sym_info as function_node;
if (fn != compar && convertion_data_and_alghoritms.function_eq_params(fn, compar))
//if (fn is common_namespace_function_node && compar is common_namespace_function_node && (fn as common_namespace_function_node).comprehensive_namespace == (compar as common_namespace_function_node).comprehensive_namespace)
if (fn is common_namespace_function_node && compar is common_namespace_function_node && (fn as common_namespace_function_node).comprehensive_namespace == (compar as common_namespace_function_node).comprehensive_namespace)
AddError(new FunctionDuplicateDefinition(compar, fn));
}
@ -2723,7 +2723,8 @@ namespace PascalABCCompiler.TreeConverter
{
if (fn_common.name != meth.name)
{
syntax_tree_visitor.AddError(fn_common.loc, "AMBIGUITY_BETWEEN_NAMES_{0}_AND_{1}", fn_common.name, meth.name);
// SSM 21.12.19 - закомментировал - исправляет баг #2163. Не пойму, зачем эта проверка
//syntax_tree_visitor.AddError(fn_common.loc, "AMBIGUITY_BETWEEN_NAMES_{0}_AND_{1}", fn_common.name, meth.name);
}
}
else

View file

@ -1926,6 +1926,8 @@ function ReadArrString(prompt: string; n: integer): array of string;
// -----------------------------------------------------
/// Возвращает двумерный массив размера m x n, заполненный указанными значениями по строкам
function Matr<T>(m,n: integer; params data: array of T): array [,] of T;
/// Возвращает двумерный массив, заполненный значениями из одномерных массивов
function Matr<T>(params aa: array of array of T): array [,] of T;
/// Возвращает двумерный массив размера m x n, заполненный случайными целыми значениями
function MatrRandom(m: integer := 5; n: integer := 5; a: integer := 0; b: integer := 100): array [,] of integer;
/// Возвращает двумерный массив размера m x n, заполненный случайными целыми значениями
@ -10044,6 +10046,18 @@ begin
end;
end;
function Matr<T>(params aa: array of array of T): array [,] of T;
begin
var cols := aa.Max(a -> a.Length);
var r := new T[aa.Length,cols];
for var i:=0 to aa.Length-1 do
for var j:=0 to aa[i].Length-1 do
r[i,j] := aa[i][j];
Result := r;
end;
// Реализация операций с матрицами - только после введения RowCount и ColCount
function MatrRandom(m: integer; n: integer; a, b: integer): array [,] of integer;
begin

View file

@ -230,7 +230,7 @@ type
/// Видимость графического объекта
property Visible: boolean
read InvokeBoolean(()->ob.Visibility = Visibility.Visible)
write Invoke(procedure -> if value then ob.Visibility := Visibility.Visible else ob.Visibility := Visibility.Hidden);
write Invoke(procedure -> if value then begin gr.Visibility := Visibility.Visible; ob.Visibility := Visibility.Visible end else begin gr.Visibility := Visibility.Hidden; ob.Visibility := Visibility.Hidden end);
/// Выравнивание текста внутри графического объекта
property TextAlignment: Alignment write Invoke(WTA,Value);
/// Размер шрифта текста внутри графического объекта