If Var1 = "A"

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Lo4438
Posts: 53
Joined: 18 May 2022, 10:00

If Var1 = "A"

23 Feb 2023, 05:13

Code: Select all

If Var1 = "A"
{Msgbox, "yes"}
Can anyone tell me if this is right?
User avatar
Scr1pter
Posts: 1277
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: If Var1 = "A"

23 Feb 2023, 05:50

Code: Select all

F1::
if Var1 = "A"
{
  Msgbox, "yes"
}
return
Keep in mind that if Var1 = A can also be correct,
depending on how the exact value is.

Var1 = "A" and Var1 = A is not the same

Cheers
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
User avatar
Scr1pter
Posts: 1277
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: If Var1 = "A"

23 Feb 2023, 05:56

Edit:
Sorry, this is now AHK v2 section.

So I can't guarantee for my post ;)
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
User avatar
mikeyww
Posts: 27198
Joined: 09 Sep 2014, 18:38

Re: If Var1 = "A"

23 Feb 2023, 07:36

Code: Select all

#Requires AutoHotkey v2.0
Var1 := "A"
If Var1 = "A"
 MsgBox "Yes"
User avatar
boiler
Posts: 17215
Joined: 21 Dec 2014, 02:44

Re: If Var1 = "A"

23 Feb 2023, 07:59

@Lo4438 — It looks like you probably are using AHK v1. Is that correct? If so, I’ll move this to the appropriate forum as we have just reorganized them to make the main sections for v2 (and may rename them to make it more clear).
User avatar
mikeyww
Posts: 27198
Joined: 09 Sep 2014, 18:38

Re: If Var1 = "A"

23 Feb 2023, 08:02

For clarity in v1:

Code: Select all

#Requires AutoHotkey v1.1.33
Var1 := "A"
If (Var1 = "A")
 Msgbox Yes
Lo4438
Posts: 53
Joined: 18 May 2022, 10:00

Re: If Var1 = "A"

23 Feb 2023, 09:02

Thx for your answer, brother.
I just use v1.
Ihave other problem, how to convert "A" to a text?
User avatar
mikeyww
Posts: 27198
Joined: 09 Sep 2014, 18:38

Re: If Var1 = "A"

23 Feb 2023, 09:11

"A" indicates a text letter.
User avatar
boiler
Posts: 17215
Joined: 21 Dec 2014, 02:44

Re: If Var1 = "A"

23 Feb 2023, 10:13

Moved thread to v1 section.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 186 guests