This reminds me of an incident 2 years back. My CEO decide to indulge in x++ programming (he is functional) and the first method he had a look was something like the one that you have mentioned. After spending 30 minutes he said this does not make sense, it is as if this method is saying "Hello, I am me" *lol*
anyway to answer your question
EmplName[1] name[2](EmplName n = _emp.name)[3]
{
_emp.name = n; [4]
return n; [5]
}
[1] returning value is of type EmplName
[2] name of the method
[3] if this value is not provided while calling the method the assign this the value _emp.name
[4] assign the value of n to _emp.name
[5] return the value of n.
Typically while instantiating a class you would call class.name("Harry"). This will set the value of _emp.name to "Harry". Next time you want to use this value you just call class.name() this will return the value "Harry". So basically you use the same method to set the value and retrive the value.
Please also note that as per latest best practices "_" is reserved for variables that are being passed as parameters. so your method declaration would be
EmplName name(EmplName _emplName = emp.name)
regards
harry
Thomas <[EMAIL PROTECTED]> wrote:
Hello,
I am used to programming Java and C#. But for some reason I have
problems understanding this syntax:
EmplName name(EmplName n = _emp.name)
{
_emp.name = n;
return n;
}
I understand the following:
the method name returns an EmplName. when calling the method you do it
with a parameter n of the type EmplName. But what dows the n =
_emp.name do? and what goes on in the method body?
SPONSORED LINKS
Computer part Programming languages Microsoft axapta Support exchange
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "development-axapta" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
---------------------------------
Start your day with Yahoo! - make it your home page
[Non-text portions of this message have been removed]
YAHOO! GROUPS LINKS
- Visit your group "development-axapta" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

