Posted by Chris Stillwell on April 22, 2001 at 21:45:04:
In Reply to: Re: what the.... posted by Z on April 22, 2001 at 21:25:20:
Mine have those, too. I guess it just depends on where your Plant and Animal lists are declared? Mine are included in my Ecosystem object, and that's declared in main and associated to my Manager object. So when they enter scope, it's for pretty much the entire program.
: Thanks for the response Chris, but what could it be a scope issue with? The Plant and Animal lists
: already have those funky sizes even before the first no-comment command is executed.
: : This one I can tell you what's probably happening. It's a scope problem, most likely. Your lists contain whatever was in memory before they got ahold of it. When they enter your function, they perform as expected. When they leave your funtion, they leave scope, forget everything, and go back to having their funky values.
: : : Before my program executes the first command, my
: : : Plant list and Animal list already have sizes, right
: : : before it enters the function that executes the first
: : : push, my Plant list has a size of 4, and Animal list
: : : has a size of something like 347896, but then when
: : : it enters the function that executes the first push,
: : : suddenly both become 0 as they should be, then the push
: : : is executed and one of them becomes a size of 1, then
: : : it leaves the function and gets those crazy sizes again,
: : : what in Gods name is going on?
Post a Followup