Like Mister_e says, Visual Basic is event driven. You have to think a lot differently when using visual basic. Everything needs an event to fire. A button must be pressed, the comm port must have received new data, text must have been typed into the text box, a timer must have timed out, etc. On each one of those events, code can be written to do math, change characters, do lookups, store data into a database ... whatever.
One way to think about it might be to compare it to programming in picbasic, but solely using interrupts. Each event is handled by the interrupt handler for that event. Like Steve mentions, until an event happens, VB just waits.
Attached is a comm port program that acts on comm port data received. http://www.innovatic.dk/knowledg/Ser.../SerialCOM.htm




Bookmarks