Like I said in my previous message : "It is only possible to add new
parameters to existing ones. It is not possible to change existing
parameters. Always remember to set a default value on the new
parameters".
In your case the problem is : "Always remember to set a default
value on the new parameters".
animal()
{
void talk()
{
print "animal talk";
}
}
dog() extends animal
{
void talk(int z=1) // instead of : void talk(int z)
{
print "dog talk";
pause;
}
}
--- In [EMAIL PROTECTED], Danny Gaethofs
<[EMAIL PROTECTED]> wrote:
> Jens,
>
> Apparently overloading is not working, but the error message I get
is questionable.
>
> I Just created the following classes:
>
> animal()
> {
> void talk()
> {
> print "animal talk";
> }
>
> }
>
> dog() extends animal
> {
> void talk(int z)
> {
> print "dog talk";
> }
> }
>
> Now I get the error message "an overloaded function has an
incorrect number of parameters".
>
> It is because I added the parameter the method became overloaded.
>
> So I think overloading is not possible. Maybe someone out there
has an example that shows the opposite.
>
> regards,
> Danny
>
>
> Jens Fudge <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> Normally in OOP there are these "definitions"
>
> override a method:
> In an inherited class, you can override a method with the same
number of
> parameters, where the parameters must be of the same type as the
ancestor.
> Hence when you call the method, you don't see any difference in
the method
> calls. In Axapta you may call Super() as to also have the
ancestors code
> run.
> I think Axapta even calls it overwrite
>
> overload a method:
> This is done in either one level or more levels of inheritance. It
simply
> means that you can have two or more methods with the same name.
The methods
> must then differ in the parameterlist. Either by number or by type.
> I do not think that its possible to overload in Axapta.
>
> Jens Fudge
>
>
>
>
> "dgaethofs"
>
<[EMAIL PROTECTED]
>
com> To
> development-
[EMAIL PROTECTED]
> 26-07-2004
15:23 cc
>
>
Subject
> Please respond to [development-axapta]
Override
> development-axapt versus
Overload
>
[EMAIL PROTECTED]
>
>
>
>
>
>
>
>
>
> Dear all,
>
> I have a question about the difference between override and
> overload. In the developers guide one talks about the two as if
they
> are the same. But they are not.
>
> Can we overload methods in Axapta ?
> What exactly is meant with overloading in Axapta?
>
> Regards,
> Danny
>
>
> Yahoo! Groups
Sponsor
>
>
>
>
ADVERTISEMENT
> click
here
>
>
>
>
>
>
>
> Yahoo! Groups Links
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/development-axapta/
>
> To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
>
>
> Yahoo! Groups SponsorADVERTISEMENT
>
>
> ---------------------------------
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/development-axapta/
>
> To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
>
>
>
> ---------------------------------
> Do you Yahoo!?
> New and Improved Yahoo! Mail - Send 10MB messages!
>
> [Non-text portions of this message have been removed]
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

