Example: /Main/Timer in Console App

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

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.


💬 Ask a question or report a problem