一个类中如何调用非该类的重名过程。问了好多人都不知道
procedure gg;
begin
Application.MessageBox('马迪 ', '晕死ua', MB_OK + MB_ICONINFORMATION);
end;
procedure Test.gg;
begin
Application.MessageBox('我操', '麻痹', MB_OK +
MB_ICONINFORMATION);
end;
procedure Test.KK;
begin
gg;
end;
//如果不想用class过程,也可以给过程起个别名
type
TPGG = procedure();
end;
procedure gg;
begin
Application.MessageBox('马迪 ', '晕死ua', MB_OK + MB_ICONINFORMATION);
end;
var
pg:TPGG = gg;
procedure TForm1.gg;
begin
Application.MessageBox('我操', '麻痹', MB_OK +
MB_ICONINFORMATION);
end;
procedure TForm1.KK;
begin
pg;
end;
// 或者用类似名字空间的方式
unit Unit2;
interface
uses
Forms;
procedure gg();
implementation
procedure gg();
begin
Application.MessageBox('sdfdsf','fdsfs'); //;
end;
end.
....
unit Unit1;
type test = class;
gg;
end;
uses unit_1;
procedure test.gg;
begin
Unit2.gg; // 显示给出Unit2
end;