BB___SCAN

=SCAN= toc

Description
> The SCAN statement is used to check for events like key presses, mouse clicks or expired timer events. It checks the event queue and if any event has fired it will redirect the program to the event handler. If not the program continues without stopping. > > In the example below two events have been set up, the button event and the trapclose event. Both are set to redirect control to the branch label [quit]. > > If scan were not in the [start] loop, the event queue would never be checked and the program would be locked in that loop. > > See also WAIT. >

Syntax

 * 1) SCAN

Example
code format="vbnet" ' If you remove the Scan statement from the loop ' the only way to quit the program is with the Ctrl+Break combo

button #1.b, "End", [quit], LR, 50, 10 open "Scan Test" for window as #1
 * 1) 1 "trapclose [quit]"

[start] scan a=a+a goto [start]

[quit] close #1 end code

Useful Functions
code format="vbnet" Place a useful function using this command here code