Liberty BASIC Help Online |
WAIT
Description:
This simple statement causes program execution to stop and wait for user input events. When the user interacts with a window or other control owned by the program and generates an event, program execution resumes at the event handler appropriate for their interaction.
Usage:
'demonstrate the wait command (in three places)
nomainwin
open "Geometric wite-board" for graphics_nsb as #geo
print #geo, "trapclose [quit]"
print #geo, "when rightButtonUp [popupMenu]"
wait ' stop and wait for a menu item to be chosen
[popupMenu]
popupmenu "&Square Spiral", [asSquare], "&Triangular Spiral", [asTriangle]
wait
[asSquare]
print #geo, "cls ; home ; down ; color red"
for x = 1 to 120
print #geo, "go "; x; " ; turn 87"
next x
wait
[asTriangle]
print #geo, "cls ; home ; down ; color blue"
for x = 1 to 120
print #geo, "go "; x; " ; turn 117"
next x
wait
[quit]
close #geo
end
Note: In general, Liberty BASIC encourages the use of wait over the previous practice of using input.
Copyright (C) 2003 Shoptalk Systems
Liberty BASIC - http://www.libertybasic.com/