首页 > lang > for 
 en fr de es it nl pl pt pt_BR mk sq ca hu cs tr ar fa id vi ko ja ru zh eo
前一个  下一个  编辑  重命名  撤销  搜索  管理  
文档  
警告! 该页面未翻译。  参见英文版 
FOR
FOR Variable = Expression TO Expression [ STEP Expression ]
   ...
NEXT

Repeats a loop while incrementing or decrementing a variable.

The loop variable must be:

If the initial expression is higher than the final expression (for positive STEP values), or if the initial expression is less than the final expression (for negative ones) the loop will not be executed at all.

Example

DIM iCount AS Integer

FOR iCount = 1 TO 20 STEP 3
  PRINT iCount;;
NEXT
-
1 4 7 10 13 16 19

参见

Loop Control Structures