Page 1 of 1

Variables

Posted: 11 Feb 2017, 09:49
by fedek
StringReplace, appdata2, A_AppData, Roaming, Local
folder := \Chrome\profr.ini
Folder:="%appdata2%\Google\%folder%"
The leftmost character above is illegal in an expression.
Thats just an example. The idea is that i have two variables with \ and how to make a one folder frome two ofther (%appdata2%; %folder%) and text part (\Google\).
Hope its real.

Re: Variables

Posted: 11 Feb 2017, 09:59
by guest3456
fedek wrote:

Code: Select all

StringReplace, appdata2, A_AppData, Roaming, Local
folder := \Chrome\profr.ini
Folder:="%appdata2%\Google\%folder%"
The leftmost character above is illegal in an expression.
Thats just an example. The idea is that i have two variables with \ and how to make a one folder frome two ofther (%appdata2%; %folder%) and text part (\Google\).
Hope its real.
yes its possible and quite easy
read here:
https://autohotkey.com/docs/Variables.htm

Re: Variables

Posted: 11 Feb 2017, 10:01
by Gicu

Code: Select all

variable := variable1 "\Text\" variable2
; or
variable = %variable1%\Text\%variable2%

Re: Variables

Posted: 11 Feb 2017, 13:24
by fedek
StringReplace, appdata2, A_AppData, Roaming, Local
Folder:=%appdata2%\Google\Chrome\User Data\Default\Web Data

StringReplace, appdata2, A_AppData, Roaming, Local
Folder:=appdata2"\Google\Chrome\User Data\Default\Web Data"

Both errors, guys. The leftmost character above is illegal in an expression

Re: Variables

Posted: 11 Feb 2017, 13:39
by guest3456
you didn't read the page that I linked to.

Re: Variables

Posted: 11 Feb 2017, 15:19
by fedek
I did, i think that i got it, but i dont know english well. So, whats the decision?

Re: Variables

Posted: 11 Feb 2017, 15:31
by Gicu

Code: Select all

variable := variable1 "\Text\" variable2
Folder := appdata2 "\Google\Chrome\User Data\Default\Web Data"
; or
variable = %variable1%\Text\%variable2%
Folder = %appdata2%\Google\Chrome\User Data\Default\Web Data

Re: Variables

Posted: 11 Feb 2017, 15:32
by 4GForce
Gicu wrote:

Code: Select all

variable := variable1 "\Text\" variable2
; or
variable = %variable1%\Text\%variable2%
Notice the spaces in the 1st example and notice the = sign in the second
This is equivalent to the first example he gave you ... also notice the spaces on each sides of the dots

Code: Select all

variable := variable1 . "\Text\" . variable2

Re: Variables

Posted: 12 Feb 2017, 08:38
by fedek
Tahks. My bad with spaces.