none
Time.Tick = Doesn't Work on My System RRS feed

  • Question

  • Hello everyone.

    I cannot seem to get Timer.Tick to work on my system. When I type the following:

    Timer.Tick = OnTimerTick

    '

    sub OnTimerTick

    'stuff

    endsub

    I get the following error message:

    "Cannot find property 'Tick' in 'Timer'.

    I get a similar error when trying to use Time.Interval(). Any thoughts? I am using Small Basic v 1.0 on a Windows 7 Home Premium laptop.

    Thanks for any help you can provide.

    Tuesday, November 8, 2011 9:35 PM

Answers

  • ayarell,

    Try this!  Works for me.

    Timer.Interval=1000

    Timer.Tick = OnTimerTick

    '

    sub OnTimerTick
    TextWindow.WriteLine("This is a Tick")
    'stuff

    endsub

    JR


    Jricestk
    Wednesday, November 9, 2011 12:39 AM
    Answerer

All replies

  • ayarell,

    Try this!  Works for me.

    Timer.Interval=1000

    Timer.Tick = OnTimerTick

    '

    sub OnTimerTick
    TextWindow.WriteLine("This is a Tick")
    'stuff

    endsub

    JR


    Jricestk
    Wednesday, November 9, 2011 12:39 AM
    Answerer
  • Thanks Jr. Your code snippet worked for me too.

    I am curious what step I missed though. When I pasted my code above back into Small Basic, it worked. However it didn't work before. Maybe some kind of glitch?

     

    Thanks again.

    Thursday, November 10, 2011 12:53 AM
  • Agh. This glitch is really annoying and you're solution doesn't always work for me, sorry.
    Thursday, April 28, 2016 4:35 PM
  • I think this glitch may be ue to an extension (cant remember which, perhaps the Data extension) that had a method or property called Timer.Tick that over-rode the main SB event so it couldn't be found.

    This is why most extension methods now start with LD, FC ELS etc to isolate them from any other extension or SB methods.

    Also the timer works on a separate thread, so UI graphics will only be updated after the tick sub ends, and if the timer intervalis too short for the work that is done (i.e. called fasterthan it takes to do the work) there may be problems.

    Thursday, April 28, 2016 5:29 PM
    Moderator