1.

Solve : Can we display the content of a variable that itself is the content of another ??

Answer»

Hi all

How to display the content of a variable that is itself composed of a variable
for example, if we have a variable its name is Age and contain on VALUE 35 , so we can display its value by writing the below line in batch SCRIPTING.

Code: [Select]SET "Age=35"
echo %Age% and the result will be '35'

but if the name itself of that variable is inside another variable like the below line

Code: [Select]set "var=Age"
set "%Age%=35"
, so we can display the content of 'var' variable by the below line

Code: [Select]echo %var% and the result will be 'Age'
my QUESTION here is :
Can we display the content of 'Age' variable using 'var' variable?
And if we can How to do this step? Code: [Select]echo off
set "var=Age"
set "%var%=35"
call echo %%%var%%%
SETLOCAL ENABLEDELAYEDEXPANSION
echo !%var%!Thanks and Appreciate Squashman



Discussion

No Comment Found