In the following (simplified example) batch file I am having difficulty correctly setting Y
:
@Echo off
setlocalenabledelayed Expansion
set EqS=Nope
set X=Eq
set Y=%X%S
echo Y
How can I get the output of this script to be Nope
instead of EqS
?
The second method of creating references in Python is by assigning a variable to another variable: var1 = var2 , where both var1 and var2 are two distinct variables. For example, let the variable var2 contain the value 2 .
type variableName = value; Where type is a C# type (such as int or string ), and variableName is the name of the variable (such as x or name). The equal sign is used to assign values to the variable.
Here is some code: window. onload = function show(){ var x = 3; } function trig(){ alert(x); } trig();
PHP variables: Assigning by Reference PHP (from PHP4) offers another way to assign values to variables: assign by reference. This means that the new variable simply points the original variable. Changes to the new variable affect the original, and vice a verse.
As Karl ask, there could be different meanings of your question.
I try to give an answer for each possibility
@echo off
setlocal EnableDelayedExpansion
set EqS=Nope
set X=Eq
REM set Y1 to "EqS"
set Y1=%X%S
REM set Y2 to "Nope" (content of EqS)
set Y2=!%X%S!
REM set Y3 to "!EqS!"
set Y3=^^!%X%S^^!
echo %Y1%
echo %Y2%
echo %Y3%
set EqS=Something
echo(
echo Text %Y1%
echo Content %Y2%
echo Pointer %Y3%
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With