Re: how to confirm a variable's value is reset?
Re: how to confirm a variable's value is reset?
- Subject: Re: how to confirm a variable's value is reset?
- From: David Rowland <email@hidden>
- Date: Tue, 12 Jun 2007 10:54:46 -0700
Kirk Wythers wrote:
Sorry for the simplistic question, but I am new to xcode and I'm
trying to figure out how to step through my code to check that a
variable gets reset to zero each year (I suspect that it is not).
For example in this code snipit the variable woodDecRespYr gets reset
to zero at the beginning of each year evidenced by the fact that each
year prints out a new and reasonable total, while the soilDecRespYr
appears to get incremented, essentially doubling each year. It is odd
since both variables should get reset to zero in the function that I
have copied below.
/*----------------------------------------------------------------------
Initialize annual and total varaibles
-----------------------------------------------------------------------*/
bool TVeg::newYearCN(TDay *day)
{
soilDecRespYr = 0.0;
woodDecRespYr = 0.0;
}
It's a member function, so it can see member data that is not shown
here. It has a bool return type but doesn't use it. The parameter is
also not used.
This must have been stripped out of context. Since it seems impossible
this fragment could produce the error you describe, it must be happening
elsewhere, and you will need to look elsewhere.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden