I would like to write a FOR
loop in a batch file to create some variables.
I'm setting up variables in a menu that has 60 options. Variables item1
to item60
contain menu items some of which are empty. The variable %pad%
contains 40 spaces. So the following code ensures that each menu item dis1
to dis60
is 40 characters long.
set dis1=%item1%%pad%
set dis1=%dis1:~0,40%
So the problem is I need to repeat this code 60 times as follows:
set dis1=%item1%%pad%
set dis1=%dis1:~0,40%
To...
set dis60=%item60%%pad%
set dis60=%dis60:~0,40%
Please could you tell me a FOR
loop to accomplish this task. I'm not sure how to increment the 1-60 value since it's inside a variable.