for Loop - Numerical Form
for Loop - Numerical Form
for VAR = START, LIMIT [ , STEP ] do BLOCK end
The behavior is undefined if you assign to VAR inside the block. The default step is +1. If expressions are passed, they are evaluated only once, before the loop starts.The loop variable VARis local to the statement;you cannot use it after the loop ends. If you need the value of the index, assign it to another variable before breaking.A break exits a for loop.