Archive: Variable in a string


Variable in a string
I feel that this very likely is a stupid question, but I've been unable to locate an answer so...

I need to insert a variable into a line of code without spaces.
Example:

Var /GLOBAL VAR1
Var /GLOBAL VAR2
WriteRegStr HKCU "SOFTWARE\blah blah" "Test" "00$VAR1text$VAR2"


Obviously the compiler thinks it's looking for $VAR1text variable that does not exist. How can I separate the variable from the text in the string?

Also the other defines work because they have the {} wrapper, but I can't always use those:

!define VAR1 "blah blah"
!define VAR2 "blah blah"
WriteRegStr HKCU "SOFTWARE\blah blah" "Test" "00${VAR1}text${VAR2}"


Thanks, folks~

You shouldn't be having that problem, I can't even replicate it. Maybe you could post the actual code you're using cause there's nothing wrong with this particular example; you definitely shouldn't be getting a compiler error.