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: Greg Guerin <email@hidden>
- Date: Tue, 12 Jun 2007 11:23:48 -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).
I suggest setting a breakpoint on the function that resets your variable to
0. When the breakpoint fires, inspect the variable values before they are
zeroed (and step thru the function confirming they are zeroed, if you
wish). If the breakpoint never fires, the function is never getting
called, strongly suggesting how the variable is not being reset to 0.
>bool TVeg::newYearCN(TDay *day)
> {
> soilDecRespYr = 0.0;
> woodDecRespYr = 0.0;
> }
It seems odd to me that you're not using the 'day' parameter at all, and
not returning a bool type, either (or returning a random one). With no
context in which to interpret these oddities, it's impossible to guess what
effect they may have on the rest of your program. It might not be benign.
-- GG
_______________________________________________
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