# WHILE

WHILE Expression

Begins a loop structure delimited by WHILE ... WEND instructions. The loop is repeated while Expression is true. If the expression is false, the loop is never executed at all. DO WHILE ... LOOP and WHILE ... WEND are equivalent.

Example

    PUBLIC SUB Form_Open()

      DIM a AS Integer

      a = 1

      WHILE a <= 10
        PRINT "Hello World"; a
        INC a
      WEND

    END

See also

BREAK, CONTINUE, DO, FOR, FOR EACH, LOOP, REPEAT, UNTIL, WITH

Previous: WEND Next: WITH