Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
Forward declaration
A function can be declared without having it followed by it's implementation, by hav-
ing it followed by the forward procedure. The effective implementation of that func-
tion must follow later in the unit. The function can be used after a forward declara-
tion as if it had been implemented already. The following is an example of a forward
declaration:
program Volume;
var Volume : word;
function First(a, b : word) : word; forward;
function Second(c : word) : word;
var tmp : word;
begin
tmp := First(2, 3);
result := tmp * c;
end;
function First(a, b : word) : word;
begin
result := a * b;
end;
begin
Volume := Second(4);
end.
142
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroPASCAL PRO for PIC
CHAPTER 6