For
For is a command block used to repeat a group of actions a predetermined number of times. This loop uses a default counter variable called $loopIndex to track the progress of the iteration.
🎥 Watch the tutorial video: Here.
Configuration parameters in the For loop:
🟢 Start: The starting value of the loop variable
$loopIndex.🔴 End: The ending value. The loop will stop when
$loopIndexreaches the valueEnd - 1.⚡ Increase by: The step (increment value) of
$loopIndexafter each completed iteration.
Practical example: Combining the For loop to read all data from an Excel file
Suppose you have an Excel file named test.xlsx and you need to configure a script to read all data in column B of this file. You can combine the For loop with the system variable $inputExcelTotalRows as follows:
🎥 Watch the tutorial video: Here.



Last updated
Was this helpful?