go_away

Author Topic: What is the "DoEvents" command?  (Read 1072 times)

0 Members and 1 Guest are viewing this topic.

Offline SciTech02Topic starter

  • Robot Overlord
  • ****
  • Posts: 136
  • Helpful? 3
  • Life's but a green duck with soy sauce. -MegaHAL
What is the "DoEvents" command?
« 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?  ???
Check out the Evolution Robotics, ER1 robot, and ERSP Resource Page: http://www.societyofrobots.com/member_tutorials/node/336

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: What is the "DoEvents" command?
« Reply #1 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.
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

 


Get Your Ad Here