I'm trying to create a variable that will link to others based off of a variable result, but can't seem to get it to work. Here's the code:
@echo off
set rollnumbera=10
set /a num=%random% %%rollnumbera +1
set "message=msg%num%"
set msg1=a
set msg2=b
set msg3=c
set msg4=d
set msg5=e
set msg6=f
set msg7=g
set msg8=h
set msg9=i
set msg10=j
echo %message%
echo %num%
pause
When I run it it displays the msg%num%
result, but does not seem to be linking to the set msg#s. I'm wondering if there is a way to do that, or if an "if %num% == message number (echo message)"
is required. This is just an ease of access question, but any advice would be appreciated.