Camillia
asked on
"Return" in C#
Please help me understand why C# throws this error when there's already a return statement there? I can add another return to fix it but why does it do that?
This is how I can fix it
This is how I can fix it
public decimal CashBonusBalance
{
set {this.label_CashBonusBalance.Text = string.Format("{0:C}",value);}
get
{
if (label_CashBonusBalance != null)
return decimal.Parse(label_CashBonusBalance.Text);
return 0; //**** adding an extra return
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
WinForm code from 2002. This is the least of the problems on this project. I'll fix it, tho.
Thanks for the help, as always.