LoginLogin

WHILE/REPEAT loops

Root / Submissions / [.]

12Me21Created:

WHILE ... WEND

WHILE condition 'if condition is 0, jump past WEND
 'Code to run
WEND 'jump to WHILE
The same thing, but written using IF and GOTO:
@LOOP
 IF condition==0 THEN GOTO @EXIT
 'Code
GOTO @LOOP
@EXIT

REPEAT ... UNTIL

REPEAT
 'code
UNTIL condition 'if condition is 0, jump to REPEAT
GOTO equivalent:
@LOOP
 'code
IF condition==0 THEN GOTO @LOOP

Examples

Infinite loop:
WHILE 1
 'code
WEND
Wait for key press:
REPEAT
 KEY$=INKEY$()
UNTIL KEY$!=""
?KEY$

For IF INSTR(string$,substring$)+1 THEN... better to have IF INSTR(string$,substring$)<0 THEN...

Replying to:SquareFingers
For IF INSTR(string$,substring$)+1 THEN... better to have IF INSTR(string$,substring$)<0 THEN...
It doesn't really make a difference Yeah, you're right.

Use header tags.

Replying to:Yolkai
Use header tags.
ok.