![xojo sleep xojo sleep](https://docplayer.net/docs-images/42/12576535/images/page_1.jpg)
Everything in a Xojo program is event driven.
![xojo sleep xojo sleep](https://www.monkeybreadsoftware.de/xojo/screenshots-small/CGS2.jpg)
I strongly recommend you try forgetting the old procedural model. Move things on screen for the user entertainment, do housekeeping in your program, and so on. Just like in real life, you can go have a beer during commercials on TV. TextArea1.Text = TextArea1.Text + "How are you ?"Ĭontrary to the wait() or app.SleepCurrentThread() model, you can do all sorts of things in between the events. TextArea1.Text = TextArea1.Text + "World."+EndofLine TextArea1.Text = TextArea1.Text + "Hello " Your example could be carried out very easily by a timer Action event. So what you want to do will be carried out in the modern event driven model not as “do this, wait, do that, wait”, and so on, but as “do something every second”. Instead of waiting one second, it does something every second (or any needed interval). There is no notion of wait because intrinsically the program simply does nothing until an event happens.Ī timer creates an event at intervals. Typically, when the user clicks it triggers the execution of the button Action event. Instead of going one line after the other, they use subprograms which execute in event handlers upon actions taken by the user of the program. Xojo and other modern languages proceed otherwise.
![xojo sleep xojo sleep](https://www.omegabundle.net/images/appKitExample001.jpg)
So in essence what you want to do is go one line after the other and wait in between, just like you would have done 30 years ago. In the past, since the early days of Basica and AppleSoft basic, a program started at line 10 and went on in a procedural way one line after the other.
Xojo sleep code#
I’ve worked out that using a timer allows me to use pauses efficiently, but is there a way I can pause code in a code not in a timer, for example a TextLabel I want it to do something like this (pseudocode):Īt this point of the discussion, I feel it is necessary to make the difference between procedural code, and event driven code. Hi, so I’ve been using Xojo for a day and I’m loving it.