Skip to content

Commit

Permalink
Merge branch 'pascalabcnet:master' into test
Browse files Browse the repository at this point in the history
  • Loading branch information
spectatorBH authored Aug 14, 2023
2 parents cb29846 + 7c5dd22 commit a3fddb7
Show file tree
Hide file tree
Showing 125 changed files with 1,783 additions and 586 deletions.
3 changes: 3 additions & 0 deletions Compiler/Compiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2271,6 +2271,9 @@ public string Compile()
if (compilerOptions.UseDllForSystemUnits)
cdo.RtlPABCSystemType = NetHelper.NetHelper.FindRtlType("PABCSystem.PABCSystem");
CodeGeneratorsController.Compile(pn, CompilerOptions.OutputFileName, CompilerOptions.SourceFileName, cdo, CompilerOptions.StandartDirectories, ResourceFilesArray);
CodeGeneratorsController.EmitAssemblyRedirects(
assemblyResolveScope,
CompilerOptions.OutputFileName);
if (res_file != null)
File.Delete(res_file);
}
Expand Down
2 changes: 1 addition & 1 deletion Configuration/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "9";
public const string Build = "0";
public const string Revision = "3332";
public const string Revision = "3340";

public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Version.defs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%COREVERSION%=0
%REVISION%=3332
%REVISION%=3340
%MINOR%=9
%MAJOR%=3
151 changes: 151 additions & 0 deletions NETGenerator/AppConfigUtil.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Xml.Linq;

namespace NETGenerator
{
internal static class AppConfigUtil
{
private static class Namespaces
{
public const string Asm = "urn:schemas-microsoft-com:asm.v1";
}

private static class Elements
{
public static readonly XName Configuration = "configuration";
public static readonly XName Runtime = "runtime";

public static readonly XName AssemblyBinding = XName.Get("assemblyBinding", Namespaces.Asm);
public static readonly XName DependentAssembly = XName.Get("dependentAssembly", Namespaces.Asm);
public static readonly XName AssemblyIdentity = XName.Get("assemblyIdentity", Namespaces.Asm);
public static readonly XName BindingRedirect = XName.Get("bindingRedirect", Namespaces.Asm);
}

public static void UpdateAppConfig(
ICollection<AssemblyName> bindingRedirects,
string appConfigPath)
{
if (bindingRedirects.Count == 0) return;
var config = File.Exists(appConfigPath)
? XDocument.Load(appConfigPath)
: new XDocument(new XElement(Elements.Configuration));
var assemblyBinding = config.GetOrCreateElement(
Elements.Configuration,
Elements.Runtime,
Elements.AssemblyBinding);

var hasChanges = false;
foreach (var redirect in bindingRedirects)
{
hasChanges |= assemblyBinding.CreateOrUpdateDependentAssembly(redirect);
}

if (hasChanges)
{
config.Save(appConfigPath);
}
}

private static XElement GetOrCreateElement(this XContainer container, params XName[] names)
{
if (names.Length == 0) throw new ArgumentException("names should not be empty.", nameof(names));

var currentPosition = container;
foreach (var name in names)
{
var existingElement = currentPosition.Element(name);
if (existingElement != null)
{
currentPosition = existingElement;
}
else
{
var newElement = new XElement(name);
currentPosition.Add(newElement);
currentPosition = newElement;
}
}

return (XElement)currentPosition;
}

private static bool CreateOrUpdateDependentAssembly(this XContainer assemblyBinding, AssemblyName assemblyName)
{
var assemblyPublicKeyToken = assemblyName.GetPublicKeyToken();
if (assemblyPublicKeyToken == null) return false;
var publicKeyTokenString = string.Join(
"",
assemblyName.GetPublicKeyToken().Select(b => b.ToString("x2", CultureInfo.InvariantCulture)));
var assemblyCulture = string.IsNullOrEmpty(assemblyName.CultureInfo?.Name)
? "neutral"
: assemblyName.CultureInfo?.Name;

foreach (var dependentAssembly in assemblyBinding.Elements(Elements.DependentAssembly))
{
var identity = dependentAssembly.Element(Elements.AssemblyIdentity);
if (identity == null) continue;
var name = identity.Attribute("name")?.Value;
var publicKeyToken = identity.Attribute("publicKeyToken")?.Value;
var culture = identity.Attribute("culture")?.Value;
if (string.IsNullOrEmpty(culture)) culture = "neutral";

if (name == assemblyName.Name
&& PublicKeyTokenCorresponds(publicKeyToken)
&& assemblyCulture == culture)
{
var bindingRedirect = dependentAssembly.GetOrCreateElement(Elements.BindingRedirect);
{
return UpdateBindingRedirect(bindingRedirect);
}
}
}

var newAssembly = new XElement(
Elements.DependentAssembly,
CreateIdentityElement(),
CreateBindingRedirect());
assemblyBinding.Add(newAssembly);
return true;

bool PublicKeyTokenCorresponds(string publicKeyToken)
{
return publicKeyToken.Equals(publicKeyTokenString, StringComparison.CurrentCultureIgnoreCase);
}

bool UpdateBindingRedirect(XElement bindingRedirect)
{
var newVersion = assemblyName.Version.ToString(4);
var oldVersionRange = $"0.0.0.0-{newVersion}";
var hasChanges =
bindingRedirect.Attribute("oldVersion")?.Value != oldVersionRange
|| bindingRedirect.Attribute("newVersion")?.Value != newVersion;
if (!hasChanges) return false;

bindingRedirect.SetAttributeValue("oldVersion", oldVersionRange);
bindingRedirect.SetAttributeValue("newVersion", newVersion);
return true;
}

XElement CreateIdentityElement()
{
var element = new XElement(Elements.AssemblyIdentity);
element.SetAttributeValue("name", assemblyName.Name);
element.SetAttributeValue("publicKeyToken", publicKeyTokenString);
element.SetAttributeValue("culture", assemblyCulture);
return element;
}

XElement CreateBindingRedirect()
{
var element = new XElement(Elements.BindingRedirect);
UpdateBindingRedirect(element);
return element;
}
}
}
}
4 changes: 4 additions & 0 deletions NETGenerator/CodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

using System;
using System.Collections;
using PascalABCCompiler.NetHelper;

namespace PascalABCCompiler.CodeGenerators
{
Expand All @@ -28,6 +29,9 @@ public void Compile(SemanticTree.IProgramNode ProgramTree,string TargetFileName,
il_converter.ConvertFromTree(ProgramTree, TargetFileName, SourceFileName, options, ResourceFiles);
}

public void EmitAssemblyRedirects(AssemblyResolveScope resolveScope, string outputFileName) =>
il_converter.EmitAssemblyRedirects(resolveScope, outputFileName);

public void Reset()
{
il_converter = null;
Expand Down
25 changes: 17 additions & 8 deletions NETGenerator/NETGenerator.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)

using System;
using System.Linq;
using PascalABCCompiler.SemanticTree;
using System.Threading;
using System.Reflection;
using System.Reflection.Emit;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Diagnostics.SymbolStore;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.InteropServices;
using System.Runtime.Remoting;
using System.Security;
using System.Runtime.Versioning;
using System.Security;
using System.Text;
using System.Threading;
using NETGenerator;
using PascalABCCompiler.NetHelper;
using PascalABCCompiler.SemanticTree;

namespace PascalABCCompiler.NETGenerator
{
Expand Down Expand Up @@ -1234,6 +1236,13 @@ public void ConvertFromTree(SemanticTree.IProgramNode p, string TargetFileName,

}

public void EmitAssemblyRedirects(AssemblyResolveScope resolveScope, string targetAssemblyPath)
{
if (IsDotnet5() || IsDotnetNative()) return;
var appConfigPath = targetAssemblyPath + ".config";
AppConfigUtil.UpdateAppConfig(resolveScope.CalculateBindingRedirects(), appConfigPath);
}

private void AddSpecialInitDebugCode()
{
//il.Emit(OpCodes.Call,typeof(Console).GetMethod("ReadLine"));
Expand Down
2 changes: 2 additions & 0 deletions NETGenerator/NETGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,13 @@
<Project>{1C9C945A-586D-42A2-A06B-65D84FA7FF78}</Project>
<Name>TreeConverter</Name>
</ProjectReference>
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Configuration\GlobalAssemblyInfo.cs">
<Link>Config\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="AppConfigUtil.cs" />
<Compile Include="Config\AssemblyInfo.cs" />
<Compile Include="NETGenegratorTools.cs" />
<Compile Include="CodeGenerator.cs">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<param name="Keyword" value="Indices">
<param name="Keyword" value="LastIndexMax">
<param name="Keyword" value="LastIndexMin">
<param name="Keyword" value="RandomElement">
<param name="Keyword" value="RemoveLast">
<param name="Keyword" value="Replace">
<param name="Keyword" value="Shuffle">
Expand Down Expand Up @@ -39,6 +40,8 @@
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âîçâðàùàåò èíäåêñ ïîñëåäíåãî ìèíèìàëüíîãî ýëåìåíòà â äèàïàçîíå [0,index-1]</td></tr>
<tr><td><code><b>function</b> LastIndexMin&lt;T&gt;(Self: List&lt;T&gt;): integer; <b>where</b> T: IComparable&lt;T&gt;;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âîçâðàùàåò èíäåêñ ïîñëåäíåãî ìèíèìàëüíîãî ýëåìåíòà</td></tr>
<tr><td><code><b>function</b> RandomElement&lt;T&gt;(Self: List&lt;T&gt;): T;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âîçâðàùàåò ñëó÷àéíûé ýëåìåíò ñïèñêà</td></tr>
<tr><td><code><b>function</b> RemoveLast&lt;T&gt;(Self: List&lt;T&gt;): List&lt;T&gt;;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Óäàëÿåò ïîñëåäíèé ýëåìåíò. Åñëè ýëåìåíòîâ íåò, ãåíåðèðóåò èñêëþ÷åíèå</td></tr>
<tr><td><code><b>procedure</b> Replace&lt;T&gt;(Self: List&lt;T&gt;; oldValue, newValue: T);</code>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<HTML><HEAD><object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
<param name="Keyword" value="Add">
<param name="Keyword" value="Print">
<param name="Keyword" value="Println">
<param name="Keyword" value="ToArray"></object>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251"><link rel="StyleSheet" href="../../../default.css">
</HEAD><body><H1>Ìåòîäû ðàñøèðåíèÿ òèïà Tuple</H1>
<table border=0 cellpadding=5><tr><td><code><b>function</b> Add&lt;T1, T2, T3&gt;(Self: (T1, T2); v: T3): (T1, T2, T3);</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Äîáàâëÿåò ïîëå ê êîðòåæó</td></tr>
<tr><td><code><b>function</b> Add&lt;T1, T2, T3, T4&gt;(Self: (T1, T2, T3); v: T4): (T1, T2, T3, T4);</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Äîáàâëÿåò ïîëå ê êîðòåæó</td></tr>
<tr><td><code><b>function</b> Add&lt;T1, T2, T3, T4, T5&gt;(Self: (T1, T2, T3, T4); v: T5): (T1, T2, T3, T4, T5);</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Äîáàâëÿåò ïîëå ê êîðòåæó</td></tr>
<tr><td><code><b>function</b> Add&lt;T1, T2, T3, T4, T5, T6&gt;(Self: (T1, T2, T3, T4, T5); v: T6): (T1, T2, T3, T4, T5, T6);</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Äîáàâëÿåò ïîëå ê êîðòåæó</td></tr>
<tr><td><code><b>function</b> Add&lt;T1, T2, T3, T4, T5, T6, T7&gt;(Self: (T1, T2, T3, T4, T5, T6); v: T7): (T1, T2, T3, T4, T5, T6, T7);</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Äîáàâëÿåò ïîëå ê êîðòåæó</td></tr>
<tr><td><code><b>procedure</b> Print&lt;T1, T2&gt;(Self: (T1, T2));</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âûâîäèò êîðòåæ</td></tr>
<tr><td><code><b>procedure</b> Print&lt;T1, T2, T3&gt;(Self: (T1, T2, T3));</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âûâîäèò êîðòåæ</td></tr>
<tr><td><code><b>procedure</b> Print&lt;T1, T2, T3, T4&gt;(Self: (T1, T2, T3, T4));</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âûâîäèò êîðòåæ</td></tr>
<tr><td><code><b>procedure</b> Print&lt;T1, T2, T3, T4, T5&gt;(Self: (T1, T2, T3, T4, T5));</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âûâîäèò êîðòåæ</td></tr>
<tr><td><code><b>procedure</b> Print&lt;T1, T2, T3, T4, T5, T6&gt;(Self: (T1, T2, T3, T4, T5, T6));</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âûâîäèò êîðòåæ</td></tr>
<tr><td><code><b>procedure</b> Print&lt;T1, T2, T3, T4, T5, T6, T7&gt;(Self: (T1, T2, T3, T4, T5, T6, T7));</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âûâîäèò êîðòåæ</td></tr>
<tr><td><code><b>procedure</b> Println&lt;T1, T2&gt;(Self: (T1, T2));</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âûâîäèò êîðòåæ è ïåðåõîäèò íà íîâóþ ñòðîêó</td></tr>
<tr><td><code><b>procedure</b> Println&lt;T1, T2, T3&gt;(Self: (T1, T2, T3));</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âûâîäèò êîðòåæ è ïåðåõîäèò íà íîâóþ ñòðîêó</td></tr>
<tr><td><code><b>procedure</b> Println&lt;T1, T2, T3, T4&gt;(Self: (T1, T2, T3, T4));</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âûâîäèò êîðòåæ è ïåðåõîäèò íà íîâóþ ñòðîêó</td></tr>
<tr><td><code><b>procedure</b> Println&lt;T1, T2, T3, T4, T5&gt;(Self: (T1, T2, T3, T4, T5));</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âûâîäèò êîðòåæ è ïåðåõîäèò íà íîâóþ ñòðîêó</td></tr>
<tr><td><code><b>procedure</b> Println&lt;T1, T2, T3, T4, T5, T6&gt;(Self: (T1, T2, T3, T4, T5, T6));</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âûâîäèò êîðòåæ è ïåðåõîäèò íà íîâóþ ñòðîêó</td></tr>
<tr><td><code><b>procedure</b> Println&lt;T1, T2, T3, T4, T5, T6, T7&gt;(Self: (T1, T2, T3, T4, T5, T6, T7));</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âûâîäèò êîðòåæ è ïåðåõîäèò íà íîâóþ ñòðîêó</td></tr>
<tr><td><code><b>function</b> ToArray&lt;T&gt;(Self: (T,T)): <b>array</b> <b>of</b> T;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ïðåîáðàçóåò êîðòåæ ýëåìåíòîâ îäíîãî òèïà â ìàññèâ</td></tr>
<tr><td><code><b>function</b> ToArray&lt;T&gt;(Self: (T,T,T)): <b>array</b> <b>of</b> T;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ïðåîáðàçóåò êîðòåæ ýëåìåíòîâ îäíîãî òèïà â ìàññèâ</td></tr>
<tr><td><code><b>function</b> ToArray&lt;T&gt;(Self: (T,T,T,T)): <b>array</b> <b>of</b> T;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ïðåîáðàçóåò êîðòåæ ýëåìåíòîâ îäíîãî òèïà â ìàññèâ</td></tr>
<tr><td><code><b>function</b> ToArray&lt;T&gt;(Self: (T,T,T,T,T)): <b>array</b> <b>of</b> T;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ïðåîáðàçóåò êîðòåæ ýëåìåíòîâ îäíîãî òèïà â ìàññèâ</td></tr>
<tr><td><code><b>function</b> ToArray&lt;T&gt;(Self: (T,T,T,T,T,T)): <b>array</b> <b>of</b> T;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ïðåîáðàçóåò êîðòåæ ýëåìåíòîâ îäíîãî òèïà â ìàññèâ</td></tr>
<tr><td><code><b>function</b> ToArray&lt;T&gt;(Self: (T,T,T,T,T,T,T)): <b>array</b> <b>of</b> T;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ïðåîáðàçóåò êîðòåæ ýëåìåíòîâ îäíîãî òèïà â ìàññèâ</td></tr>
</table>
</body></HTML>
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<param name="Keyword" value="Random2">
<param name="Keyword" value="Random3">
<param name="Keyword" value="Randomize">
<param name="Keyword" value="RandomReal">
<param name="Keyword" value="Round">
<param name="Keyword" value="RoundBigInteger">
<param name="Keyword" value="Sign">
Expand Down Expand Up @@ -148,6 +149,8 @@
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Èíèöèàëèçèðóåò äàò÷èê ïñåâäîñëó÷àéíûõ ÷èñåë, èñïîëüçóÿ çíà÷åíèå seed. Ïðè îäíîì è òîì æå seed ãåíåðèðóþòñÿ îäèíàêîâûå ïñåâäîñëó÷àéíûå ïîñëåäîâàòåëüíîñòè</td></tr>
<tr><td><code><b>procedure</b> Randomize;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Èíèöèàëèçèðóåò äàò÷èê ïñåâäîñëó÷àéíûõ ÷èñåë</td></tr>
<tr><td><code><b>function</b> RandomReal(a, b: real; digits: integer := 2): real;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âîçâðàùàåò ñëó÷àéíîå âåùåñòâåííîå â äèàïàçîíå [a,b] c êîëè÷åñòâîì çíà÷àùèõ öèôð ïîñëå òî÷êè, ðàâíûì digits</td></tr>
<tr><td><code><b>function</b> Round(x: real): integer;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âîçâðàùàåò x, îêðóãëåííîå äî áëèæàéøåãî öåëîãî. Åñëè âåùåñòâåííîå íàõîäèòñÿ ïîñåðåäèíå ìåæäó äâóìÿ öåëûìè,òî îêðóãëåíèå îñóùåñòâëÿåòñÿ ê áëèæàéøåìó ÷åòíîìó (áàíêîâñêîå îêðóãëåíèå): Round(2.5)=2, Round(3.5)=4</td></tr>
<tr><td><code><b>function</b> Round(x: real; digits: integer): real;</code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
<tr><td><code><b>function</b> ArrRandom(n: integer := 10; a: integer := 0; b: integer := 100): <b>array</b> <b>of</b> integer;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âîçâðàùàåò ìàññèâ ðàçìåðà n, çàïîëíåííûé ñëó÷àéíûìè öåëûìè çíà÷åíèÿìè</td></tr>
<tr><td><code><b>function</b> ArrRandomInteger(n: integer; a: integer; b: integer): <b>array</b> <b>of</b> integer;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âîçâðàùàåò ìàññèâ ðàçìåðà n, çàïîëíåííûé ñëó÷àéíûìè öåëûìè çíà÷åíèÿìè</td></tr>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âîçâðàùàåò ìàññèâ ðàçìåðà n, çàïîëíåííûé ñëó÷àéíûìè öåëûìè çíà÷åíèÿìè â äèàïàçîíå îò a äî b</td></tr>
<tr><td><code><b>function</b> ArrRandomInteger(n: integer := 10): <b>array</b> <b>of</b> integer;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âîçâðàùàåò ìàññèâ ðàçìåðà n, çàïîëíåííûé ñëó÷àéíûìè öåëûìè çíà÷åíèÿìè</td></tr>
<tr><td><code><b>function</b> ArrRandomReal(n: integer; a: real; b: real): <b>array</b> <b>of</b> real;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âîçâðàùàåò ìàññèâ ðàçìåðà n, çàïîëíåííûé ñëó÷àéíûìè âåùåñòâåííûìè çíà÷åíèÿìè</td></tr>
<tr><td><code><b>function</b> ArrRandomReal(n: integer := 10): <b>array</b> <b>of</b> real;</code>
<tr><td><code><b>function</b> ArrRandomReal(n: integer; a: real; b: real; digits: integer := 2): <b>array</b> <b>of</b> real;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âîçâðàùàåò ìàññèâ ðàçìåðà n, çàïîëíåííûé ñëó÷àéíûìè âåùåñòâåííûìè çíà÷åíèÿìè â äèàïàçîíå îò a äî b</td></tr>
<tr><td><code><b>function</b> ArrRandomReal(n: integer := 10; digits: integer := 2): <b>array</b> <b>of</b> real;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âîçâðàùàåò ìàññèâ ðàçìåðà n, çàïîëíåííûé ñëó÷àéíûìè âåùåñòâåííûìè çíà÷åíèÿìè</td></tr>
<tr><td><code><b>function</b> ReadArrInt64(n: integer): <b>array</b> <b>of</b> int64;</code>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Âîçâðàùàåò ìàññèâ èç n öåëûõ int64, ââåäåííûõ ñ êëàâèàòóðû</td></tr>
Expand Down
Loading

0 comments on commit a3fddb7

Please sign in to comment.