Society of Robots - Robot Forum

Software => Software => Topic started by: SciTech02 on October 26, 2008, 04:09:34 PM

Title: What is the "DoEvents" command?
Post by: SciTech02 on October 26, 2008, 04:09:34 PM
I have been reading some scripts written in MS Visual Basic and there is a command used that is called "DoEvents".  This seems to be a VB-specific command, since I can't find it in any other programing language.  What is this command and what does it do?  ???
Title: Re: What is the "DoEvents" command?
Post by: airman00 on October 26, 2008, 04:41:05 PM
very simple

it finishes doing all events that were called before the command and then goes on

lets say I do this code
Textbox.text = " hello world"  ' make text box say Hello World
Doevents
MMControl.Command = "play"    ' play a sound through MMcontrol component

In that case Doevents will not do next instruction until textbox.text was completed. This is a simple example, sometimes ( like in my VB code by my butler robot) there are more complicated things that need to be done in sequence.