ID:259256
 
Well, I was going to try to have Cribbage ready for GoB tonight, but A) the scoring is a little more convoluted than I thought and B) I keep stumbling over stupid little things.

But here's one I can't make any sense out of at all. The first snippet calls the second snippet. Only the first part of the sentence gets printed. Why?

To clarify: when I run this, I see "Does this sentence...", which should mean "return 0" is getting called too. So, if I'm returning 0, then if(!IsStraight(...)) should execute the body of code below it, and I should see the end of the sentence. But I'm not. Any ideas?

//snippet 1
if(!IsStraight(myCopy.Copy(1, j + 1)))
good = 0
world << "...end?" //dbg
break


//snippet 2 (extracted from IsStraight)

if(GetLiteralValue(lv:rank) != lastRank + 1)
world << "Does this sentence..." //dbg
return 0

On 11/5/00 1:50 pm Guy T. wrote:

To clarify: when I run this, I see "Does this sentence...", which should mean "return 0" is getting called too. So, if I'm returning 0, then if(!IsStraight(...)) should execute the body of code below it, and I should see the end of the sentence. But I'm not. Any ideas?

Hmm. The code looks fine to me, so I guess I'll need more info. The first thing I would do is to completely trace the path of the proc. Put print statements above, inside, and below the proc. You've probably done this already, but I just want to be sure.

Maybe the owner of the proc is getting deleted. That could lead to unexpected exists. Perhaps the proc is crashing?

We'll have to investigate the possible scenarios, but I'm sure we'll figure it out. I had a mysterious problem like this once too; it was due to a proc deletion.
In response to Tom H.
You've probably done this already, but I just want to be sure.

Not as thoroughly as I should have! I think I may have found something I was doing wrong. Thanks for the suggestion.

Hmm... you probably already have a debugger on The List, don't you? :)