[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
QbasicFAQ_Events
What is event programming?
Back to QBasic FAQ Main Page.
Before the advent of Windows, most software was not programmed in event driven languages, but rather polled languages. Event programming is somewhat easier because, cause and action inside the program are based on the "event" taking place, rather than polling (continually checking a device, a variable, etc.).
The best way to explain this is with the way the two different methods handle mouse routines. In polled language, you must create a conditional loop while using the mouse, and once the condition is met, an action is taken. (Say using IF/ THEN or possibly SELECT CASE.) Then you must continually check to see if the mouse has performed the action.
In an event driven language. You construct the program to handle an event when it occurs.
Example: OnMouseClick PressButton1%
The operating system reports the event through the kernel, and you then can handle it.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
QbasicFAQ_Events
What is event programming?
Back to QBasic FAQ Main Page.
Before the advent of Windows, most software was not programmed in event driven languages, but rather polled languages. Event programming is somewhat easier because, cause and action inside the program are based on the "event" taking place, rather than polling (continually checking a device, a variable, etc.).
The best way to explain this is with the way the two different methods handle mouse routines. In polled language, you must create a conditional loop while using the mouse, and once the condition is met, an action is taken. (Say using IF/ THEN or possibly SELECT CASE.) Then you must continually check to see if the mouse has performed the action.
In an event driven language. You construct the program to handle an event when it occurs.
Example: OnMouseClick PressButton1%
The operating system reports the event through the kernel, and you then can handle it.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
