[code]
int numberOfDays = 0;
int total = 0;
if (validation.Month == 12 || validation.Month == 01)
{
numberOfDays = 14;
}
total += numberOfDays;
[/code]
The total variable is not storing the numberOfDays total, only 14 is for Dec and Jan, it does not increase.
Loading
Amit ChoudharyPosted Apr 28, 2010, 12:06 PM
make total global with public and static
public static int total=0;
don' t put it inside the function every time the function called it'll reinitialised with 0 and lost he prev value.
Please mark the "Do you like this post" if it helps you.
Dipa AhujaPosted Apr 28, 2010, 8:43 AM
Sarah NelPosted Apr 28, 2010, 7:42 AM
Hirendra SisodiyaPosted Apr 28, 2010, 7:20 AM
thanks
Dipa AhujaPosted Apr 28, 2010, 6:55 AM