<p>Am 29.10.2013 18:21 schrieb "waldo kitty" <<a href="mailto:wkitty42@windstream.net">wkitty42@windstream.net</a>>:<br>
><br>
><br>
> question: in simple language, how can i have a routine with differing parameters like some routines in FPC and Lazarus do? i've never attempted this before and it is completely alien to my experience but i do use the functionality quite a lot with existing routines...<br>
><br>
> description: i have a class object with an internal routine that i want to be able to pass no or different parameters to.<br>
><br>
> example: procedure MyObject.MyRoutine;<br>
> procedure MyObject.MyRoutine(VarA : SomeType);<br>
> procedure MyObject.MyRoutine(VarA : string; VarB: integer);<br>
><br>
> at one point, the first instance would be used... at another point one of the other instances would be used with the only difference being the parameters that are passed or not... i know that i would have individual instances with the necessary header and code for each... i just don't know if there is anything else special that needs to be done or if it can be done with an internal class object routine..</p>
<p>The most important point to keep in mind us that the parameters need to be different (the result type does not count though!). And you should be careful if you decide to additionally use default parameters for overloaded functions.<br>
Note: In mode Delphi and a few other cases (e.g. cross unit overloads, inheritance) you'll need to add the "overload" directive.</p>
<p>For additional information please look at the language reference guide (can't look up the link currently).</p>
<p>Regards,<br>
Sven</p>