I'm trying to convert a pure basic program but i have a problem to add +1 to some values with a timer. I do not understand why.
thanks for helping.
Code: Select all
Declare TimerEvents()
Declare GO()
Global Launch, NbrDes, Count
;- INIT
NbrDes = 3
Launch = #True
Count = 0
;--------
Procedure TimerEvents()
Protected X, Count
If Launch = #True
Count+1
X + 128
;- TEST -----------------------
Debug "X : " + X
Debug "Count : " + Count
;- EndTest ---------------------
If Count = NbrDes
X = 0
Count = 0
Launch = #False
Debug "This is the end, my only friend, the end."
EndIf
EndIf
EndProcedure
Procedure GO()
OpenWindow(0, #PB_Ignore, #PB_Ignore, 128*3, 128+50,"Virtual Dices",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
AddWindowTimer(0,1,300)
BindEvent(#PB_Event_Timer, @TimerEvents(),0)
EndProcedure
GO()