68
Programming with TIDE
©2000-2008 Tibbo Technology Inc.
The following decision structures are implemented in Tibbo Basic:
4.2.6.2
Loop Structures
Loop structures are used to iterate through a certain piece of code more than once.
This is useful in many scenarios, such as processing arrays, processing request
queues, performing string operations (such as parsing), etc.
An example of a simple loop structure would be:
dim
f, i
as
integer
f =
1
for
i =
1
to
6
f = f * i
next
i
' f is now equal to 1*2*3*4*5*6 (720).
The following loop structures are implemented in Tibbo Basic:
4.2.6.3
Doevents
Although under Tibbo Basic, event-driven programming is the norm, there may be
special cases in which you just have to linger an overly long time in one event
handler. This will block execution of other events. They will just keep accumulating
in the queue (see
).
statement has been provided. When this statement
is invoked within a procedure, the execution of this procedure is interrupted. The
VM then handles events which were present in the queue as of the moment of
doevents invocation. Once these events are handled, control is returned to the
procedure which invoked doevents.
If new events are added to the queue while doevents is executing, they will not be
processed on the same doevents 'round'. Doevents only processes those events
present in the queue at the moment it was invoked.
To summarize, doevents provides a way for a procedure to let other events
execute while the procedure is doing something lengthy.
89
91
82
86
95
7
82