Language:
Русский
English
procedure (reserved word)
A procedure is a program part that performs a specific action, often based on a set of parameters.
Syntax
procedure identifier;
OR
procedure identifier ( parameters );
Remarks
The procedure heading specifies the identifier for the procedure and the formal parameters (if any).
A procedure is activated by a procedure statement.
The procedure heading is followed by:
- a declaration part that declares local objects
- the statements between begin and end, which specify what is to be
executed when the procedure is called.
You can use the interrupt directive to declare interrupt procedures. Instead of the declaration and statement parts, a procedure declaration can specify a forward, external, or inline directive.
Example
{ Procedure Declaration }
procedure WrStr(X, Y: integer; S: string);
var
SaveX, SaveY: Integer;
begin
SaveX := WhereX;
SaveY := WhereY;
GotoXY(X, Y);
Write(S);
GotoXY(SaveX, SaveY);
end;