PDA

View Full Version : Repeat or loop



Henry
30-11-2007, 14:08
G'day I was wondering if any one here could show me a good example how to loop or reapt some fucntion

Like sleep 10 msg....

then loop that if it ends and start over at the start any help would be great

Thanks kind regards Henry

Petr Schreiber
30-11-2007, 14:24
Hi Henry,

if I understand your question, you want some thinBASIC code which allows loops ?

In thinBASIC there are many possiblities to achieve this.

For fixed number of iterations, FOR/NEXT is the best:


DIM i AS LONG ' -- counter

FOR i = 1 TO 10
MSGBOX 0, "Iteration"+STR$(i)
NEXT


For conditional loops please check example in thinBASIC helpfile under topic "thinBASIC language"\"Program flow"\"DO/LOOP"


Bye,
Petr