Not running code ?
Blitz3D Forums/Blitz3D Programming/Not running code ?
| ||
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. |
| ||
Did you check out the variables in debug step-by-step-mode if they change in an unwanted way? |
| ||
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 |
| ||
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. |
| ||
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 |
| ||
Tom: Actually, it doesn't make a difference. Try it. |