I'm learning batch script, i came across a section creating structure in array. This is the sample program given as example.When i try to execute, It is not working. Can someone explain me what is wrong script? Thanks in advance!
code:
@echo off
set len=3
set obj[0].name=Joe
set obj[0].id=1
set obj[1].name=Mark
set obj[1].id=2
set obj[2].name=mohan
set obj[2].id=3
set i=0
:loop
if %i% equ %len% goto :eof
set cur.name=
set cur.id=
for /f "usebackq delims==. tokens=1-3" %%j in ('set obj[%i%]') do (
set cur.%%k=%%l
)
echo name=%cur.name%
echo value=%cur.id%
set /a i=%i%+1
goto loop