View Single Post
Old 10th May 2013, 22:42   #1
Plainjay
Junior Member
 
Join Date: Jun 2010
Posts: 9
Question 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:
code:
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:

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



Thanks, folks~
Plainjay is offline   Reply With Quote