can someone out there explain to me what VALUE is ?? a datatype or how it gets defined?? like :
public int x; {
get
{return my_x;}
set
{return value}
}
plzzzzzz - thanks
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
can someone out there explain to me what VALUE is ?? a datatype or how it gets defined?? like :
public int x; {
get
{return my_x;}
set
{return value}
}
plzzzzzz - thanks
void x::set(int value) { my_x = value; }
@antisocial:Its the parameter passed to the setter, so you use it to set your variables.
So if I have
int x
{
get { return _x; }
set { _x = value }
}
And did thing.x = 123 value would be 123.
IMHO, the VB.NET syntax is it easier to comprehend.
Private _Prop2 As String = "Empty"
Property Prop2 As String
Get
Return _Prop2
End Get
Set(ByVal value As String)
_Prop2 = value
End Set
End PropertyIn C#
class TimePeriod
{
private double seconds;
public double Hours
{
get { return seconds / 3600; }
set { seconds = value * 3600; }
}
}
thanks all - i get it !
Ah the new C9... home of the trolls, Microsoft Kool-Aid drinkers, and kids who need help with their homework. ![]()
@DeathByVisualStudio: Stop being an anti-social jerk. There's nothing wrong with people asking for help.
Herbie
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.