Count-from-the-Initial-Value-According-to-the-Step-Size.-Continue-the-Count-Until-the-End-Value
Command Description
Replace the index into the loop and execute the statement block from for to next. The index value is from start to end times, and step is step. Each loop can increase the index by the number corresponding to step instead of 1
Command Prototype
For index = beginValue To endValue step stepValue
Next
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
index | True | id | i | Step index |
beginValue | True | number | 0 | Initial value |
endValue | True | number | 10 | End value |
stepValue | True | number | 1 | Step in |
Demo
TracePrint("------------------------------------------------Counting loops------- -----------------------------------")
//-------------------------------------------------------------------------------
//[Remarks] Substitute the index into the loop, execute the statement block between for and next , the value of the index is from start to end times, step is the step, and each loop can increase the index by step corresponds to the quantity, not 1 anymore.
TracePrint("Let i be 0, step size is 1, increment to 10, print the value of i, the result is: ")
For i = 0 To 10 Step 1
TracePrint i
Next