FUNCTION micUn_GetChecksum(CONST c_src: AnsiString;CONST c_bits: Byte = 32): LongWord;overload; FUNCTION micUn_GetChecksum(CONST c_src: WideString;CONST c_bits: Byte = 32): LongWord;overload;
摘录DELPHI HELP 解释得很清楚了You can declare more than one routine in the same scope with the same name. This is called overloading. Overloaded routines must be declared with the overload directive and must have distinguishing parameter lists. For example, consider the declarationsfunction Divide(X, Y: Real): Real; overload; begin Result := X/Y; end; function Divide(X, Y: Integer): Integer; overload; begin Result := X div Y; end;
是不是:funciton xxx(cc:integer):double;overload;//已经声名过的.
funciton xxx(cc:double):double;overload;//需要重载的.
FUNCTION micUn_GetChecksum(CONST c_src: WideString;CONST c_bits: Byte = 32): LongWord;overload;
begin
Result := X/Y;
end;
function Divide(X, Y: Integer): Integer; overload;
begin
Result := X div Y;
end;
如果在同一个类中,有两个函数或过程,他们的功能很相似,但是需要传入的参数值不同,可以考虑用overload实现,这样在调用的时候,系统会根据传入的参数表自动判断需要调用的是哪个函数。