Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: ObsidianWolf on January 31, 2004, 06:30 PM

Title: Do Events?
Post by: ObsidianWolf on January 31, 2004, 06:30 PM
I know about using DoEvents in my code and such... But I was wondering what It actually does?
Title: Re:Do Events?
Post by: dxoigmn on January 31, 2004, 06:36 PM
Quote from: ObsidianWolf on January 31, 2004, 06:30 PM
I know about using DoEvents in my code and such... But I was wondering what It actually does?

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbenlr98/html/vafctdoevents.asp (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbenlr98/html/vafctdoevents.asp)
Title: Re:Do Events?
Post by: ObsidianWolf on January 31, 2004, 07:13 PM
Was hoping for an answer that wasnt by the book, Thanks for help anyways.
Title: Re:Do Events?
Post by: dxoigmn on January 31, 2004, 07:33 PM
Quote from: ObsidianWolf on January 31, 2004, 07:13 PM
Was hoping for an answer that wasnt by the book, Thanks for help anyways.

Well, I don't think it can get more clear that that.  It returns the current number of forms loaded and passes control over to the CPU.
Title: Re:Do Events?
Post by: Fr0z3N on January 31, 2004, 09:01 PM
How blante can I say this?

Yields execution so that the operating system can process other events.
Title: Re:Do Events?
Post by: Newby on February 01, 2004, 12:45 AM
You know, I think he could have clicked the link Fr0z3N. You didn't have to copy/paste the first line of text from that article.
Title: Re:Do Events?
Post by: Adron on February 01, 2004, 04:49 AM
I looked at the disassembly of it some time, and among other things it seemed to have a PeekMessage/DispatchMessage loop to take care of any pending window messages.
Title: Re:Do Events?
Post by: Fr0z3N on February 01, 2004, 10:08 AM
Quote from: Newby on February 01, 2004, 12:45 AM
You know, I think he could have clicked the link Fr0z3N. You didn't have to copy/paste the first line of text from that article.

"Was hoping for an answer that wasnt by the book, Thanks for help anyways. "

I took that as he didn't get what he wanted by clicking the link.
Title: Re:Do Events?
Post by: Newby on February 01, 2004, 04:37 PM
Oh, okie then. :o
Title: Re:Do Events?
Post by: TheMinistered on February 02, 2004, 05:35 PM
You know, if people actually studied visual basic and KNEW what an event was... that keyword would probably make a hell of a lot more sense to them.  But who am I to argue this? ;)

[MORE!]
Do -- I think we all, by now, should know what this verb means
Events -- These are sub procedures called when something happens/etc!

Do (some) events!  Get it?

I think that this is the kindergarten technique of explaining the 'DoEvents' keyword!

[EVEN MORE!]

The following block of code will execute endlessly!  If it executes endlessly that means that we are in trouble because specific occurances (events) will not be handled, because the program is hung in this loop.  However, if inside the loop you put the 'DoEvents' keyword; the program will 'Do (Some) Events' or handle events while this loop is processing endlessly, which can be a good thing!  


Do
   V=V+1
Loop