Forward procedures and functions

Language reference ›› Procedures and functions ››
Parent Previous Next

Procedures and functions may be declared as forward (standard Pascal); the forwarded declaration argument list or function result must match the first declaration, or may be omitted.



PROCEDURE ForwardProc2(VAR X: INTEGER; Y: BYTE); FORWARD;

PROCEDURE Proc1;
VAR
 A: INTEGER;
BEGIN
 ForwardProc2(A, 12); // sets A to 12
END;

PROCEDURE ForwardProc2;
BEGIN
 X := Y;
END;