الرئيسية > lang > for 
 en fr de es it nl pl pt pt_BR mk sq ca hu cs tr fa id vi ko ja ru zh zh_TW eo
السابق  التالي  تحرير  إعادة تسمية  تراجع  بحث  الإدارة  
المستندات  
تحذير! هذه الصفحة لم يتم ترجمتها.  See english version 
FOR
FOR Variable = Expression { TO | DOWNTO } Expression [ STEP Expression ]
   ...
NEXT

Repeats a loop while incrementing or decrementing a المتغير.

The loop variable must be:

If DOWNTO is used instead of TO, then the increment step is reversed.

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.

مثال

DIM iCount AS Integer

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

FOR iCount = 10 DOWNTO 1
  PRINT iCount;;
NEXT
10 9 8 7 6 5 4 3 2 1

FOR iCount = 10 DOWNTO 1 STEP 3
  PRINT iCount;;
NEXT
10 7 4 1

إنظر أيضا

Loop Control Structures