pascalabcnet/InstallerSamples/!Tutorial/09_Units/UnitStructure/MyUnit.pas
2025-11-05 12:17:39 +03:00

29 lines
831 B
ObjectPascal
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/// Модуль упрощенной структуры
unit MyUnit; // имя модуля должно совпадать с именем файла
const Size = 100;
type IntArr = array of integer;
var Delimiter: string := ' ';
// Документирующие комментарии отображаются при наведении на имя курсора мыши
/// Заполняет массив случайными числами
function FillArr(n: integer): IntArr;
begin
Result := new integer[n];
for var i:=0 to Result.Length-1 do
Result[i] := Random(100);
end;
/// Возвращает минимальный элемент в массиве
function Min(a: IntArr): integer;
begin
Result := a[0];
for var i:=1 to a.Length-1 do
if Result > a[i] then
Result := a[i];
end;
end.