Platforms to show: All Mac Windows Linux Cross-Platform

/Main/Timer in Console App


Required plugins for this example:

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Main/Timer in Console App

This example is the version from Tue, 1st Feb 2016.

Project "Timer in Console App.xojo_binary_project"
Class App Inherits ConsoleApplication
EventHandler Function Run(args() as String) As Integer print "main thread start" // we can create timers dim t as new MyTimer t.Period = 1000 t.Mode = 2 // this is main loop of app and it will fire timers do app.DoEvents(1) loop until ende // we end when variable ende is set to true by timer print "main thread end" End EventHandler
Property ende As Boolean
End Class
Class MyTimer Inherits Timer
EventHandler Sub Action() counter = counter + 1 print CurrentMethodName+" "+str(me.counter) if counter = 5 then app.ende = true end if End EventHandler
Property counter As Integer
End Class
End Project

See also:

The items on this page are in the following plugins: MBS Main Plugin.


The biggest plugin in space...