Not running code ?

Blitz3D Forums/Blitz3D Programming/Not running code ?

Paul "Taiphoz"(Posted 2004) [#1]
bit of a weired one this.

Iv got some code, conditions which are being met, but even though the code steps through a few lines and a function the game is not executing the instructions.

	If Game_Over=True
		If MilliSecs()-Game_Over_time => Game_Over_Duration
			Enter_Name()
		End If
	End If


the above condition is met after 4 seconds. At which time it then calls the function.

All the function is then doing is called GUI() which should take the game back to the game menu.

BUT, its not executing this.

Now if I run the code in Debug mode, it still does not execute it.

BUT, if I run it in Debug, and then stop the game and step through it myself, It then Executes it.

TBH this has me really stumped.


Dreamora(Posted 2004) [#2]
Did you check out the variables in debug step-by-step-mode if they change in an unwanted way?


N(Posted 2004) [#3]
Try this and see if the variables meet the checks.
	If Game_Over=True
		Game_Over_Checker# = MilliSecs()-Game_Over_time
		DebugLog Game_Over_Checker
		DebugLog Game_Over_Duration
		Stop
		If Game_Over_Checker => Game_Over_Duration
			Enter_Name()
		End If
	End If



WolRon(Posted 2004) [#4]
While debugging, you are interfereing with time, so the Millisecs() command may not be giving you the same results that happen when running normally. This may be why it works in debug, which is why Noel is suggesting sending the variables to a log at runtime.


TomToad(Posted 2004) [#5]
Shouldn't => actually be >=?

From the Blitz manual:
Sign Meaning

= Equals
< is less than
> is greater than
<= is less than or equal to
>= is greater than or equal to
<> is unequal to


N(Posted 2004) [#6]
Tom: Actually, it doesn't make a difference. Try it.