Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3773

Console app question(s) timer

$
0
0

Hi all.

I am trying to create a console app that will allow me to control another program (guess which one :smiley: )

I found the documentation here:
https://documentation.xojo.com/topics/threading/running_code_periodically_with_a_timer.html#using-timer-in-a-console-project

But need a little bit more of an explanation on some things like:

Add the Action event to the App object and put this code to initialize the Timer and map its Action event to the TimerAction method:
 // is this the App.Run?

MyTimer = New Timer
MyTimer.Period = 1000
MyTimer.RunMode = Timer.RunModes.Multiple
AddHandler MyTimer.Action, AddressOf TimerAction

While True
  App.DoEvents
Wend

and

Now add the TimerAction method:

// i can’t seem to add an event; where is it?  Where do I put this?

Public Sub TimerAction(sender As Timer)
  Print("Timer called.”)
End Sub

Sorry for the dumb questions…

Regards

4 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 3773

Trending Articles