Hi Gökhan
 
Axapta does support overloading but not the way think. When you overload you must use default values for the parameters of you want them to be optional. You do not use more than one methos with the same name in the same class. For example:
 

void new(str _to = '',  str _from = '', str _subject = '', str _body = ''){...}

 

means that you can create an object (say MyObject) as follows:

 

MyObject myObject = new MyObject();

 

or

 

MyObject myObject = new MyObject('Text1');

 

or

 

MyObject myObject = new MyObject('Text1', 'Text2');

 

or

 

MyObject myObject = new MyObject('Text1', 'Text2', 'Text3');

 

and so on.

 

Or you could declare the first parameter or first few parameters without initial values and the others with initial values. This means that you have to pass values for those parameters without initial values and those with initial values only are optional.

 

Varden Morris

 

J. Wray & Nephew Ltd. - Group I.S.

234 Spanish Town Road

Kingston 11, Jamaica, W.I.

 

Phone:  (876) - 923 - 6141 Ext. 2400, 2412
Fax:      (876) - 923 - 5372

Cell:      (876) - 3833566
Email:   [EMAIL PROTECTED]

        [EMAIL PROTECTED]

 



Malcolm Burtt <[EMAIL PROTECTED]> wrote:
Hi
 
I'm afraid you've been mislead, Axapta only supports overriding, not overloading. Lookup "override vs. overload" in the Developers guide for confirmation.
 
Regards
 

Malcolm Burtt
Global IT Group
"Business Solutions designed for YOUR business processes"
Global IT Group is the trading name of Touchstone Global Business Solutions Ltd. and is part of the Touchstone Group PLC.

-----Original Message-----
From: Gökhan Mutlu [mailto:[EMAIL PROTECTED]
Sent: 06 December 2004 14:33
To: [EMAIL PROTECTED]
Subject: [Axapta-Knowledge-Village] constructor problem or ..

I am new to Axapta.

 

Axapta supports overloading. This is what help says..

 

But I can not define constructors with diffrent parameters for a class..

 

Example;

           

void new(){...}

 

void new(str _to,  str _from, str _subject, str _body ){...}

 

 

 

 

Gökhan Mutlu

 



Sharing the knowledge on Axapta.




Sharing the knowledge on Axapta.



Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search. Learn more.

Sharing the knowledge on Axapta.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to