I'm trying to use the ?: operator in my game, but it causes an error on startup. The temp.exe file crashes causing the Windows error reporting service to trigger. This happens in XP and Vista.
Here the expression as I'm using it in the code.
PlayerDeck.Value('num_cards')<0 ? 52 : 0[/code:397z7hxl] It's in an action that attempts to increment the value of PlayerDeck.Value('num_cards') by either 52 or 0 Am I using the expression correctly?
I think it's a bit buggy. You might want to throw brackets around every operand:
(PlayerDeck.Value('num_cards') < 0) ? (52) : (0)
If that doesn't help, it's probably totally broken, so ditch it and use subevents instead.
I tried brackets everywhere and even took out the spaces:
((PlayerDeck.Value('num_cards'))<0)?(52):(0)[/code:2q11itv5] It still gave the same error so I guess I'll have to go with the subevents. Thanks
Develop games in your browser. Powerful, performant & highly capable.
I added the bug to the tracker, so hopefully it'll be fixed soon.
ooh, thanks. I still haven't even gone through and learned how to submit a bug report.
You people are too nice.