Very Strange Error Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Very Strange Error

21 Feb 2018, 15:03

I have this code:

Code: Select all

If ( Var = W) {
Var2:= 123
Var3:= 456
} Else {
MsgBox %Var%
}
And I keep getting the MsgBox With W.
Should I record it and make it a Gif?
Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Re: Very Strange Error

21 Feb 2018, 15:14

I´m just trying to humor it because its very disappointing to finish everything after a month and then figure out something like that wrecked me.
garry
Posts: 3758
Joined: 22 Dec 2013, 12:50

Re: Very Strange Error

21 Feb 2018, 15:19

sarcasm / irony ? .. nothing strange here ...

Code: Select all

w  :=2
var:=2   ;- 'var' is same then 'w'
;var:=3  ;- else
If ( Var = W)
 {
 Var2:= 123
 Var3:= 456
 msgbox,VAR2=%var2%`nVar3=%var3%
 }
Else
  MsgBox,VAR= %Var%
return
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Very Strange Error  Topic is solved

21 Feb 2018, 15:34

Perhaps you want:

Code: Select all

if (Var = "W")
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Re: Very Strange Error

21 Feb 2018, 17:05

Thanks Garry and Jeeswg! I´m so relieved it worked.
What made me give up was that the code without the quotes worked before and works on a test script.
I still have no idea why it behaves like that. I´m glad its working and I´m putting a large stone on top of It.
I´m not Lexikos to worry about it.
Thanks so much!
My Regards!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 257 guests