How can I write two functions with the same name with different parameter types like this:
public
{ Public declarations }
function MsgW(const Msg:String):Integer;
function MsgW(const Msg:String;title:String):Integer;
function MsgW(const Msg:String;title:String):Integer;
Begin
Result := MessageboxW(0,Pchar(Msg),Pchar(title),MB_OK);
End;
function MsgW(const Msg:String):Integer;
Begin
Result := MessageboxW(0,Pchar(Msg),'MessageBoxW',MB_OK);
End;
Use overload directive
function MsgW(const Msg:String):Integer; overload;
function MsgW(const Msg:String;title:String):Integer; overload;
Overloading Methods
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With