We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't get LDTimers to work
#2
LitDev,

I did get this to work by putting in a while program delay loop. Here's the code:

'Name=LDTimer.AddTick("OnTimerTick")
'LDTimer.Interval(Name,0)

Name=LDTimer.Add()
LDTimer.Interval(Name,0)
LDTimer.Tick=OnTimerTick

While "True"
Program.Delay(0)
EndWhile

Sub OnTimerTick
TextWindow.WriteLine("Here")
EndSub

Notice there isn't any actual delay, but the program keeps on running. So, originally it doesn't have enough time for the tick event to occur, but with the SB timer it is able to do it. Interesting!

JR

My question now is does each of the ldtimers run on a separate thread?
Reply


Messages In This Thread
Can't get LDTimers to work - by jrmrhrb00 - 12-25-2023, 08:44 PM
RE: Can't get LDTimers to work - by jrmrhrb00 - 12-26-2023, 12:17 AM
RE: Can't get LDTimers to work - by WhTurner - 12-26-2023, 11:20 AM
RE: Can't get LDTimers to work - by litdev - 12-26-2023, 11:53 AM
RE: Can't get LDTimers to work - by jrmrhrb00 - 12-26-2023, 03:41 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)