7.0 - , . , , . , . High. , . , , High.
2.14. . :
Function Max(Var Mas: array of lnteger): lnteger;
Var : Integer; i: Byte;
Begin - Mas[0];
For i:= 1 to High(Mas) Do
If < Mas[i] then := Mas[i];
Max: =
End;
. , , , . .
- , OpenString, String $+. , , - , :
Procedure FullChar(Var Str: OpenString; Ch: Char);
$+ Procedure FillChar(Var Str: String; Ch: Char);
- -
- -, .. . -, .. Var.
, .
- - , : $F+ far, , , inline interrupt.
2.15. , .
Program EXAMPLE_2_5;
Type Func = function(X,Y:lnteger): Integer;
{$F+}
Function Add(X, Y: Integer): Integer;
Begin Add:= X +Y End;
Function Multiply(X, Y: Integer): Integer; Begin Multiply: = X * Y End;
{$F-} { }
Procedure PrintTable(A, : Integer; Operation: Func);
|
|
Var i, j: Integer;
Begin
For i:= 1 to A do
begin
For j: = 1 to do
Write(0peration(i,j): 5);
end;
WriteLn
End;
BEGIN
PrintTable(10, 5, Add); Writeln;
PrintTable(10, 5, Multiply)
END.
EXIT
, GOTO . EXIT. EXIT .
2.16. , .
Function Minus(Var Massiv; N: Integer): Real; { Massiv - }
Begin Minus:= 0;
For i:= 1 to do
if T(Massiv)[i] < 0 Then { }
begin
Minus:= T(Massiv)[i];
EXIT { }
end
End;
.
- . . , , , , .
EXTERNAL , . ASSEMBLER . . INLINE , . INTERRUPT , .
[5, .62; 4, .8.2, . 11.1-11.8].