I'm trying to set a variable with the value from an array in a batch file, but no solution seems to work so far. Here's a snippet of the situation:
:: random value
set ParId=123
:: get the last number of the previous value
set /a "temp0=%ParId% %% 10"
:: part of my array, just for the example
set AsciiNumTable[0]=0x30
set AsciiNumTable[1]=0x31
set AsciiNumTable[2]=0x32
set AsciiNumTable[3]=0x33
set AsciiNumTable[4]=0x34
set AsciiNumTable[5]=0x35
set AsciiNumTable[6]=0x36
set AsciiNumTable[7]=0x37
set AsciiNumTable[8]=0x38
set AsciiNumTable[9]=0x39
:: PART NOT WORKING
set ParIdByte0=AsciiNumTable[%temp0%]
I've tried different methods:
call set ParIdByte0=%AsciiNumTable[!tempId5!]%
but they also do not work.
If I output the array and the temp variable they look fine, so I don't know why I can't get the value from the array.