在我的 DPR 里面
procedure A;
begin
...
B;
...
end;
procedure B;
begin
...
A;
...
end;
如何在 DPR 內處理這種情況?在普通單元內很容易我只需要在interface單元部分中宣告這兩個程序,但在 dpr 內如何做,因為它們沒有介面部分。
uj5u.com熱心網友回復:
您需要使用前向宣告:
procedure B; forward;
procedure A;
begin
if 1 1 = 3 then
B;
end;
procedure B;
begin
if 1 1 = 3 then
A;
end;
(當然,前向宣告也可以用在單元的實作部分,所以你不需要為了讓兩個實作部分的例程相互了解而污染單元的介面。)
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/527484.html
標籤:德尔福
上一篇:從api獲取好友并在前端顯示
